diff options
author | Lea Wiemann <lewiemann@gmail.com> | 2008-06-01 01:11:21 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-01 05:32:17 +0400 |
commit | 1bd9c648408e3dd79882ab4c23af3b791c9e3c21 (patch) | |
tree | 24710b2aedd1336dee0edd8b82fd7258788ad448 /t/test-lib.sh | |
parent | d2b3691b61d516a0ad2bf700a2a5d9113ceff0b1 (diff) |
t/test-lib.sh: resolve symlinks in working directory, for pathname comparisons
Without this, some tests will fail because they compare command output
of subprocesses (such as git) with $PWD -- but subprocesses have the
physical path as their working directory, whereas $PWD contains the
symlinked path. This fixes it.
Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index 3bf570b068..7a8bd27abc 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -419,7 +419,9 @@ rm -fr "$test" || { } test_create_repo "$test" -cd "$test" || exit 1 +# Use -P to resolve symlinks in our working directory so that the cwd +# in subprocesses like git equals our $PWD (for pathname comparisons). +cd -P "$test" || exit 1 this_test=$(expr "./$0" : '.*/\(t[0-9]*\)-[^/]*$') for skp in $GIT_SKIP_TESTS |