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>
Lea Wiemann committed
May 31, 2008 at 23:11 UTC
1bd9c648408e3dd79882ab4c23af3b791c9e3c21
1 file changed
+3
-1
t/test-lib.sh
+3
-1
@@ -419,7 +419,9 @@ rm -fr "$test" || {
419
}
420
421
test_create_repo "$test"
422
-cd "$test" || exit 1
422
+# Use -P to resolve symlinks in our working directory so that the cwd
423
+# in subprocesses like git equals our $PWD (for pathname comparisons).
424
+cd -P "$test" || exit 1
425
426
this_test=$(expr "./$0" : '.*/\(t[0-9]*\)-[^/]*$')
427
for skp in $GIT_SKIP_TESTS