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`
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);