Skip to content

Commit

Permalink
t7510: test a commit signed by an unknown key
Browse files Browse the repository at this point in the history
We tested both good and bad signatures, but not ones made
correctly but with a key for which we have no trust.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jun 17, 2014
1 parent 7b1732c commit 4baf839
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions t/t7510-signed-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ test_expect_success GPG 'create signed commits' '
test_tick && git rebase -f HEAD^^ && git tag sixth-signed HEAD^ &&
git tag seventh-signed
echo 8 >file && test_tick && git commit -a -m eighth -SB7227189 &&
git tag eighth-signed-alt
'

test_expect_success GPG 'show signatures' '
Expand All @@ -63,6 +66,16 @@ test_expect_success GPG 'show signatures' '
! grep "BAD signature from" actual &&
echo $commit OK || exit 1
done
) &&
(
for commit in eighth-signed-alt
do
git show --pretty=short --show-signature $commit >actual &&
grep "Good signature from" actual &&
! grep "BAD signature from" actual &&
grep "not certified" actual &&
echo $commit OK || exit 1
done
)
'

Expand Down

0 comments on commit 4baf839

Please sign in to comment.