t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables

We have to use $PWD instead of $(pwd) because on Windows the latter would add a C: style path to bash's Unix-style $PATH variable, which becomes confused by the colon after the drive letter. ($PWD is a Unix-style path.) In the case of GIT_ALTERNATE_OBJECT_DIRECTORIES, bash on Windows assembles a Unix-style path list with the colon as separators. It converts the value to a Windows-style path list with the semicolon as path separator when it forwards the variable to git.exe. The same confusion happens when bash's original value is contaminated with Windows style paths. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Sixt committed Nov 11, 2016 at 18:31 UTC 71dd50472d6be8ff91ab0dcfa2413daeaba14baa
2 files changed +3 -3
t/t0021-conversion.sh
+1 -1
@@ -4,7 +4,7 @@ test_description='blob conversion via gitattributes'
4
5 . ./test-lib.sh
6
7 -TEST_ROOT="$(pwd)"
7 +TEST_ROOT="$PWD"
8 PATH=$TEST_ROOT:$PATH
9
10 write_script <<\EOF "$TEST_ROOT/rot13.sh"
t/t5615-alternate-env.sh
+2 -2
@@ -31,14 +31,14 @@ test_expect_success 'objects inaccessible without alternates' '
31 '
32
33 test_expect_success 'access alternate via absolute path' '
34 - check_obj "$(pwd)/one.git/objects" <<-EOF
34 + check_obj "$PWD/one.git/objects" <<-EOF
35 $one blob
36 $two missing
37 EOF
38 '
39
40 test_expect_success 'access multiple alternates' '
41 - check_obj "$(pwd)/one.git/objects:$(pwd)/two.git/objects" <<-EOF
41 + check_obj "$PWD/one.git/objects:$PWD/two.git/objects" <<-EOF
42 $one blob
43 $two blob
44 EOF