]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7510: use $PWD instead of $(pwd) inside PATH
authorJeff King <peff@peff.net>
Fri, 25 Jul 2025 05:13:09 +0000 (01:13 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jul 2025 15:07:42 +0000 (08:07 -0700)
On Windows, $(pwd) will give us a Windows-style path like "D:/foo".
Putting that into $PATH confuses anybody parsing that variable, since
colon is a separator character in $PATH. Instead, we should use the
Unix-style value we get from $PWD ("/d/foo").

This is similar to the cases fixed by 71dd50472d (t0021, t5615: use $PWD
instead of $(pwd) in PATH-like shell variables, 2016-11-11).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7510-signed-commit.sh

index 95d2ebe27793f07c10667931c671d1e1f56b1bcf..1201c85ba62af8d0300bb01fda8a14623a68a806 100755 (executable)
@@ -458,7 +458,7 @@ test_expect_success 'custom `gpg.program`' '
 
        # `gpg.program` does not specify an absolute path, it should find a program in `$PATH`
        test_config gpg.program "fake-gpg" &&
-       env PATH="$(pwd):$PATH" \
+       env PATH="$PWD:$PATH" \
        git commit -S --allow-empty -m signed-commit
 '