From dae6c322fa106d72dabd7551f388715e6a9f2ebf Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Wed, 27 Jan 2016 07:58:06 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- environment.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'environment.c') diff --git a/environment.c b/environment.c index 2da7fe2e06..b329024f13 100644 --- a/environment.c +++ b/environment.c @@ -87,6 +87,13 @@ int auto_comment_line_char; /* Parallel index stat data preload? */ int core_preload_index = 1; +/* + * This is a hack for test programs like test-dump-untracked-cache to + * ensure that they do not modify the untracked cache when reading it. + * Do not use it otherwise! + */ +int ignore_untracked_cache_config; + /* This is set by setup_git_dir_gently() and/or git_default_config() */ char *git_work_tree_cfg; static char *work_tree; -- cgit v1.2.3