Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-11 07:52:34 +0300
committerJunio C Hamano <gitster@pobox.com>2022-08-11 07:52:34 +0300
commit4f049a16bf47c97639cb78b3ede3c6888fe91987 (patch)
tree21adbf5990c31e433a30e0f09c89a4da8e78a992 /read-cache.c
parent340a6120e5efdc37edc2a2dbc7ddc6befd5e6995 (diff)
parent4447d4129d944eb136fd5c35014cc2b370a2d752 (diff)
Merge branch 'tk/untracked-cache-with-uall' into maint
Fix for a bug that makes write-tree to fail to write out a non-existent index as a tree, introduced in 2.37. source: <20220722212232.833188-1-martin.agren@gmail.com> * tk/untracked-cache-with-uall: read-cache: make `do_read_index()` always set up `istate->repo`
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index 76f372ff91..4de207752d 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2294,6 +2294,8 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
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;
}