Re: [PATCHv4 4/4] t7510: test verify-commit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 27, 2014, 19:32 UTC
- Message-ID
- <xmqqk382173l.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <02b475e94770ed809e18e6258d593242abd23569.1403877431.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> sed -e "s/seventh/7th forged/" raw >forged1 && > git hash-object -w -t commit forged1 >forged1.commit && > + ! git verify-commit $(cat forged1.commit) &&
test_must_fail git verify-commit ... &&
Show 8 quoted lines
> git show --pretty=short --show-signature $(cat forged1.commit) >actual1 && > grep "BAD signature from" actual1 && > ! grep "Good signature from" actual1 > @@ -94,6 +110,7 @@ test_expect_success GPG 'detect fudged signature with NUL' ' > cat raw >forged2 && > echo Qwik | tr "Q" "\000" >>forged2 && > git hash-object -w -t commit forged2 >forged2.commit && > + ! git verify-commit $(cat forged2.commit) &&
test_must_fail git verify-commit ... &&
Show 11 quoted lines
> git show --pretty=short --show-signature $(cat forged2.commit) >actual2 && > grep "BAD signature from" actual2 && > ! grep "Good signature from" actual2 > @@ -102,6 +119,7 @@ test_expect_success GPG 'detect fudged signature with NUL' ' > test_expect_success GPG 'amending already signed commit' ' > git checkout fourth-signed^0 && > git commit --amend -S --no-edit && > + git verify-commit HEAD && > git show -s --show-signature HEAD >actual && > grep "Good signature from" actual && > ! grep "BAD signature from" actual
Most of the tests, unlike "git show --show-signature" tests, do not seem to check the output from the command. Is it because its primary interface to scripts is its exit status [*1*]?
[Footnote]
*1* "Yes" is totally an acceptable answer and a justification for not checking the output in many of these tests.