From: Junio C Hamano Date: Wed, 3 Aug 2022 20:36:07 +0000 (-0700) Subject: Merge branch 'tk/untracked-cache-with-uall' X-Git-Tag: v2.38.0-rc0~107 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1a0db23ad269d46ae43fd34d04ab6065081a92f;p=thirdparty%2Fgit.git Merge branch 'tk/untracked-cache-with-uall' Fix for a bug that makes write-tree to fail to write out a non-existent index as a tree, introduced in 2.37. * tk/untracked-cache-with-uall: read-cache: make `do_read_index()` always set up `istate->repo` --- f1a0db23ad269d46ae43fd34d04ab6065081a92f diff --cc read-cache.c index 76f372ff91,68ed65035b..4de207752d --- a/read-cache.c +++ b/read-cache.c @@@ -2294,7 -2269,8 +2294,9 @@@ int do_read_index(struct index_state *i fd = open(path, O_RDONLY); if (fd < 0) { if (!must_exist && errno == ENOENT) { + if (!istate->repo) + istate->repo = the_repository; + set_new_index_sparsity(istate); return 0; } die_errno(_("%s: index file open failed"), path);