summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLibravatar Christian Couder <christian.couder@gmail.com>2016-01-27 07:58:06 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-01-27 12:30:07 -0800
commitdae6c322fa106d72dabd7551f388715e6a9f2ebf (patch)
treebcd583c221fbbd0c62dc5a66b1a7a46a35f915ed /config.c
parentconfig: add core.untrackedCache (diff)
downloadtgif-dae6c322fa106d72dabd7551f388715e6a9f2ebf.tar.xz
test-dump-untracked-cache: don't modify the untracked cache
To correctly perform its testing function, test-dump-untracked-cache should not change the state of the untracked cache in the index. As a previous patch makes read_index_from() change the state of the untracked cache and as test-dump-untracked-cache indirectly calls this function, we need a mechanism to prevent read_index_from() from changing the untracked cache state when it's called from test-dump-untracked-cache. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/config.c b/config.c
index 647a15ef72..b95ac3a9cd 100644
--- a/config.c
+++ b/config.c
@@ -1599,6 +1599,10 @@ int git_config_get_untracked_cache(void)
int val = -1;
const char *v;
+ /* Hack for test programs like test-dump-untracked-cache */
+ if (ignore_untracked_cache_config)
+ return -1;
+
if (!git_config_get_maybe_bool("core.untrackedcache", &val))
return val;