Re: [PATCH v2 2/2] t7510: add test cases for non-absolute gpg program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 22, 2025 at 09:09:22PM +0200, Jonas Brandstötter wrote:

>  	test_must_fail env LET_GPG_PROGRAM_FAIL=1 \
>  	git commit -S --allow-empty -m must-fail 2>err &&
> -	grep zOMG err
> +	grep zOMG err &&
> +
> +	# `gpg.program` starts with `~`, the path should be interpreted to be relative to `$HOME`
> +	test_config gpg.program "~/fake-gpg" &&
> +	env HOME="$(pwd)" \
> +	git commit -S --allow-empty -m signed-commit &&
> +
> +	# `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" \
> +	git commit -S --allow-empty -m signed-commit

This second test seems to fail on Windows. E.g., in this CI job:

  https://github.com/git/git/actions/runs/16509422831/job/46688307091

Right before the failure, the trace shows that we are setting PATH like
this:

  ++env 'PATH=D:/a/git/git/t/trash directory.t7510-signed-commit:/d/a/git/git:/d/a/git/git/t/helper:/c/Users/runneradmin/path:/mingw64/bin:/usr/bin/:/usr/bin/core_perl:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem'

Should it be "/d/a/git/git/..." instead of "D:/a/git/git/..."? Which we
could get by using $PWD, I think.

The earlier one using $HOME uses D:/, but this one is different because
colons are meaningful separators in $PATH.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux