]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1308: do not get fooled by symbolic links to the source tree
authorJunio C Hamano <gitster@pobox.com>
Thu, 2 Jun 2016 22:06:55 +0000 (15:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Jun 2016 22:22:24 +0000 (15:22 -0700)
When your $PWD does not match $(/bin/pwd), e.g. you have your copy
of the git source tree in one place, point it with a symbolic link,
and then "cd" to that symbolic link before running 'make test', one
of the tests in t1308 expects that the per-user configuration was
reported to have been read from the true path (i.e. relative to the
target of such a symbolic link), but the test-config program reports
a path relative to $PWD (i.e. the symbolic link).

Instead, expect a path relative to $HOME (aka $TRASH_DIRECTORY), as
per-user configuration is read from $HOME/.gitconfig and the test
framework sets these shell variables up in such a way to avoid this
problem.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1308-config-set.sh

index 065d5ebb09fa0d3dbc5d2abc3be0cb815cca17f6..cf716b469f10f37a591b32ef2d3eb6da4ba63f78 100755 (executable)
@@ -237,7 +237,7 @@ test_expect_success 'iteration shows correct origins' '
        key=foo.bar
        value=from-home
        origin=file
-       name=$(pwd)/.gitconfig
+       name=$HOME/.gitconfig
        scope=global
 
        key=foo.bar