]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tk/untracked-cache-with-uall'
authorJunio C Hamano <gitster@pobox.com>
Wed, 3 Aug 2022 20:36:07 +0000 (13:36 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Aug 2022 20:36:07 +0000 (13:36 -0700)
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`

1  2 
read-cache.c
t/t7063-status-untracked-cache.sh

diff --cc read-cache.c
index 76f372ff9175eaf3a4a47cc97fb8b475393fbc64,68ed65035bbe5757a6714a4afb388609cb175cf8..4de207752dc217d0b8c43b373f453c8d846d6173
@@@ -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);
Simple merge