Skip to content

Commit 71dd504

Browse files
j6tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0538b84 commit 71dd504

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

t/t0021-conversion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_description='blob conversion via gitattributes'
44

55
. ./test-lib.sh
66

7-
TEST_ROOT="$(pwd)"
7+
TEST_ROOT="$PWD"
88
PATH=$TEST_ROOT:$PATH
99

1010
write_script <<\EOF "$TEST_ROOT/rot13.sh"

t/t5615-alternate-env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ test_expect_success 'objects inaccessible without alternates' '
3131
'
3232

3333
test_expect_success 'access alternate via absolute path' '
34-
check_obj "$(pwd)/one.git/objects" <<-EOF
34+
check_obj "$PWD/one.git/objects" <<-EOF
3535
$one blob
3636
$two missing
3737
EOF
3838
'
3939

4040
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
4242
$one blob
4343
$two blob
4444
EOF

0 commit comments

Comments
 (0)