Skip to content

Commit fab5968

Browse files
committed
Merge branch 'jb/t7510-gpg-program-path'
A new test to ensure that a recent change will keep working. * jb/t7510-gpg-program-path: t7510: use $PWD instead of $(pwd) inside PATH t7510: add test cases for non-absolute gpg program
2 parents 8e75941 + c26ecaf commit fab5968

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

t/t7510-signed-commit.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,17 @@ test_expect_success 'custom `gpg.program`' '
449449
450450
test_must_fail env LET_GPG_PROGRAM_FAIL=1 \
451451
git commit -S --allow-empty -m must-fail 2>err &&
452-
grep zOMG err
452+
grep zOMG err &&
453+
454+
# `gpg.program` starts with `~`, the path should be interpreted to be relative to `$HOME`
455+
test_config gpg.program "~/fake-gpg" &&
456+
env HOME="$(pwd)" \
457+
git commit -S --allow-empty -m signed-commit &&
458+
459+
# `gpg.program` does not specify an absolute path, it should find a program in `$PATH`
460+
test_config gpg.program "fake-gpg" &&
461+
env PATH="$PWD:$PATH" \
462+
git commit -S --allow-empty -m signed-commit
453463
'
454464

455465
test_done

0 commit comments

Comments
 (0)