]> git.ipfire.org Git - thirdparty/git.git/blobdiff - read-cache.c
Merge branch 'tk/untracked-cache-with-uall'
[thirdparty/git.git] / read-cache.c
index 76f372ff9175eaf3a4a47cc97fb8b475393fbc64..4de207752dc217d0b8c43b373f453c8d846d6173 100644 (file)
@@ -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;
                }