threads / patch / 56369

patcht9001: PATH must not use Windows-style paths

Subject: [PATCH] t9001: PATH must not use Windows-style paths

## tl;dr

2 messages between Aug 24, 2021 and Aug 25, 2021. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Johannes Sixt· Aug 24, 2021, 18:01 UTC · lore

On Windows, $(pwd) returns a drive-letter style path C:/foo, while $PWD contains a POSIX style /c/foo path. When we want to interpolate the current directory in the PATH variable, we must not use the C:/foo style, because the meaning of the colon is ambiguous. Use the POSIX style.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 This belongs on top of branch ga/send-email-sendmail-cmd.
 t/t9001-send-email.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to t/t9001-send-email.sh +1 −1
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 57fc10e7f8..595cbad372 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -2198,7 +2198,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' '
 
 test_expect_success $PREREQ 'test using command name with --sendmail-cmd' '
 	clean_fake_sendmail &&
-	PATH="$(pwd):$PATH" \
+	PATH="$PWD:$PATH" \
 	git send-email \
 		--from="Example <nobody@example.com>" \
 		--to=nobody@example.com \
-- 
2.33.0.129.g739793498e
Johannes Schindelin· Aug 25, 2021, 12:27 UTC · re: Johannes Sixt · lore

Re: [PATCH] t9001: PATH must not use Windows-style paths

Hi Hannes,
On Tue, 24 Aug 2021, Johannes Sixt wrote:
Show 6 quoted lines
> On Windows, $(pwd) returns a drive-letter style path C:/foo, while $PWD
> contains a POSIX style /c/foo path. When we want to interpolate the
> current directory in the PATH variable, we must not use the C:/foo style,
> because the meaning of the colon is ambiguous. Use the POSIX style.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Thank you, Dscho

Show 23 quoted lines
> ---
>  This belongs on top of branch ga/send-email-sendmail-cmd.
>
>  t/t9001-send-email.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
> index 57fc10e7f8..595cbad372 100755
> --- a/t/t9001-send-email.sh
> +++ b/t/t9001-send-email.sh
> @@ -2198,7 +2198,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' '
>
>  test_expect_success $PREREQ 'test using command name with --sendmail-cmd' '
>  	clean_fake_sendmail &&
> -	PATH="$(pwd):$PATH" \
> +	PATH="$PWD:$PATH" \
>  	git send-email \
>  		--from="Example <nobody@example.com>" \
>  		--to=nobody@example.com \
> --
> 2.33.0.129.g739793498e
>
>

← back to recent threads