Merge branch 'ds/core-untracked-cache-config'

Setting core.untrackedCache to true failed to add the untracked
cache extension to the index.

* ds/core-untracked-cache-config:
  dir: force untracked cache with core.untrackedCache
This commit is contained in:
Junio C Hamano 2022-02-25 15:47:36 -08:00
commit 80f7f618b6

4
dir.c
View file

@ -2936,7 +2936,9 @@ int read_directory(struct dir_struct *dir, struct index_state *istate,
if (force_untracked_cache < 0)
force_untracked_cache =
git_env_bool("GIT_FORCE_UNTRACKED_CACHE", 0);
git_env_bool("GIT_FORCE_UNTRACKED_CACHE", -1);
if (force_untracked_cache < 0)
force_untracked_cache = (istate->repo->settings.core_untracked_cache == UNTRACKED_CACHE_WRITE);
if (force_untracked_cache &&
dir->untracked == istate->untracked &&
(dir->untracked->dir_opened ||