summaryrefslogtreecommitdiff
path: root/test-dump-untracked-cache.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2016-01-27 06:58:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-01-27 20:30:07 (GMT)
commitdae6c322fa106d72dabd7551f388715e6a9f2ebf (patch)
treebcd583c221fbbd0c62dc5a66b1a7a46a35f915ed /test-dump-untracked-cache.c
parent435ec090ec6aed9c533e096b31947b3fa765548e (diff)
downloadgit-dae6c322fa106d72dabd7551f388715e6a9f2ebf.zip
git-dae6c322fa106d72dabd7551f388715e6a9f2ebf.tar.gz
git-dae6c322fa106d72dabd7551f388715e6a9f2ebf.tar.bz2
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 'test-dump-untracked-cache.c')
-rw-r--r--test-dump-untracked-cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test-dump-untracked-cache.c b/test-dump-untracked-cache.c
index 25d855d..0a1c285 100644
--- a/test-dump-untracked-cache.c
+++ b/test-dump-untracked-cache.c
@@ -44,6 +44,10 @@ int main(int ac, char **av)
{
struct untracked_cache *uc;
struct strbuf base = STRBUF_INIT;
+
+ /* Hack to avoid modifying the untracked cache when we read it */
+ ignore_untracked_cache_config = 1;
+
setup_git_directory();
if (read_cache() < 0)
die("unable to read index file");