Skip to content

Commit 9dd3982

Browse files
szedergitster
authored andcommitted
t7510-signed-commit: use 'test_must_fail'
The two tests 'detect fudged signature' and 'detect fudged signature with NUL' in 't7510-signed-commit.sh' check that 'git verify-commit' errors out when encountering a forged commit, but they do so by running ! git verify-commit ... Use 'test_must_fail' instead, because that would catch potential unexpected errors like a segfault as well. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3e55249 commit 9dd3982

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t7510-signed-commit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ test_expect_success GPG 'detect fudged signature' '
145145
146146
sed -e "s/seventh/7th forged/" raw >forged1 &&
147147
git hash-object -w -t commit forged1 >forged1.commit &&
148-
! git verify-commit $(cat forged1.commit) &&
148+
test_must_fail git verify-commit $(cat forged1.commit) &&
149149
git show --pretty=short --show-signature $(cat forged1.commit) >actual1 &&
150150
grep "BAD signature from" actual1 &&
151151
! grep "Good signature from" actual1
@@ -156,7 +156,7 @@ test_expect_success GPG 'detect fudged signature with NUL' '
156156
cat raw >forged2 &&
157157
echo Qwik | tr "Q" "\000" >>forged2 &&
158158
git hash-object -w -t commit forged2 >forged2.commit &&
159-
! git verify-commit $(cat forged2.commit) &&
159+
test_must_fail git verify-commit $(cat forged2.commit) &&
160160
git show --pretty=short --show-signature $(cat forged2.commit) >actual2 &&
161161
grep "BAD signature from" actual2 &&
162162
! grep "Good signature from" actual2

0 commit comments

Comments
 (0)