diff options
| author | Jonas Brandstötter <jonas.brandstoetter@gmx.at> | 2025-07-22 21:09:22 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-22 13:28:58 -0700 |
| commit | 26ef8872f1ccb095ef7d263edac1e844d6516bfd (patch) | |
| tree | da10e76cd1acf6d86ea868d12325aedbf1156400 | |
| parent | 7d275cd5c04645de4da789ace92cae6b03d3c93d (diff) | |
t7510: add test cases for non-absolute gpg program
These cases cover scenarios where `gpg.program` is set as a program in
`$PATH` or as a path relative to the user's home directory.
Signed-off-by: Jonas Brandstötter <jonas.brandstoetter@gmx.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rwxr-xr-x | t/t7510-signed-commit.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh index 39677e859a..95d2ebe277 100755 --- a/t/t7510-signed-commit.sh +++ b/t/t7510-signed-commit.sh @@ -449,7 +449,17 @@ test_expect_success 'custom `gpg.program`' ' 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 ' test_done |
