Skip to content

Commit

Permalink
verify-commit: add test for exit status on untrusted signature
Browse files Browse the repository at this point in the history
verify-tag exits successfully if the signature is good but the key is
untrusted.  verify-commit exits unsuccessfully.  This divergence in
behavior is unexpected and unwanted.  Since verify-tag existed earlier,
add a failing test to have verify-commit share verify-tag's behavior.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
brian m. carlson authored and Junio C Hamano committed Jun 22, 2015
1 parent a4cc18f commit 8e98e5f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions t/t7510-signed-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ test_expect_success GPG 'verify and show signatures' '
)
'

test_expect_failure GPG 'verify-commit exits success on untrusted signature' '
git verify-commit eighth-signed-alt 2>actual &&
grep "Good signature from" actual &&
! grep "BAD signature from" actual &&
grep "not certified" actual
'

test_expect_success GPG 'show signed commit with signature' '
git show -s initial >commit &&
git show -s --show-signature initial >show &&
Expand Down

0 comments on commit 8e98e5f

Please sign in to comment.