Re: [PATCHv4 4/4] t7510: test verify-commit
From: Michael J Gruber <hidden>
Date: 2016-06-15 23:01:45
On 27. Juni 2014 21:32:30 MESZ, Junio C Hamano [off-list ref] wrote:
Michael J Gruber [off-list ref] writes:quoted
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 ... &"ed
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 signaturewith NUL' 'quoted
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 ... &&
Sorry for missing or mis-rebasing these. I meant to cover them all.
quoted
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 signaturewith NUL' 'quoted
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" actualMost 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.
Yes, the idea was to check the exit status in all cases (the loopy subtests) and the textual output in a few exemplary ones. I didn't want to bloat the test unnecessarily. Michael