summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-02-25 15:47:36 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-02-25 15:47:36 -0800
commit80f7f618b612cb7415e34d139aab0808cc8679d6 (patch)
tree59be88f28dc068b607f3bc4c37e48f15cc7f59af
parentMerge branch 'ab/diff-free-more' (diff)
parentdir: force untracked cache with core.untrackedCache (diff)
downloadtgif-80f7f618b612cb7415e34d139aab0808cc8679d6.tar.xz
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
-rw-r--r--dir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index d91295f2bc..79a5f6918c 100644
--- a/dir.c
+++ b/dir.c
@@ -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 ||