Michael J Gruber <g...@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 ... &&

>       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 ... &&

>       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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to