test-lib.sh: unset XDG_CACHE_HOME
authorGenki Sky <sky@genki.is>
Fri, 16 Feb 2018 02:46:04 +0000 (21:46 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Feb 2018 19:23:10 +0000 (11:23 -0800)
git respects XDG_CACHE_HOME for the credential cache. So, we should
unset XDG_CACHE_HOME for the test environment, lest a user's custom one
cause failure in the test.

For example, t/t0301-credential-cache.sh expects a default directory
to be used if it hasn't explicitly set XDG_CACHE_HOME.

Signed-off-by: Genki Sky <sky@genki.is>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh
index 23c29bce6edbb5b921145e80849600896c2e1e3f..fa99a856e8349ddea94bb9499b333bdc669e6155 100644 (file)
@@ -104,6 +104,7 @@ unset VISUAL EMAIL LANGUAGE COLUMNS $("$PERL_PATH" -e '
        my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
        print join("\n", @vars);
 ')
        my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
        print join("\n", @vars);
 ')
+unset XDG_CACHE_HOME
 unset XDG_CONFIG_HOME
 unset GITPERLLIB
 GIT_AUTHOR_EMAIL=author@example.com
 unset XDG_CONFIG_HOME
 unset GITPERLLIB
 GIT_AUTHOR_EMAIL=author@example.com