summaryrefslogtreecommitdiff
path: root/t/t7510-signed-commit.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-06-04 13:39:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-11 17:19:03 (GMT)
commit9dd39821e3d0adf3f160642589291965c73a529e (patch)
tree9e99c4034552454e675a688d824f1b508eb1f5ce /t/t7510-signed-commit.sh
parent3e5524907b43337e82a24afbc822078daf7a868f (diff)
downloadgit-9dd39821e3d0adf3f160642589291965c73a529e.zip
git-9dd39821e3d0adf3f160642589291965c73a529e.tar.gz
git-9dd39821e3d0adf3f160642589291965c73a529e.tar.bz2
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 <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7510-signed-commit.sh')
-rwxr-xr-xt/t7510-signed-commit.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 762135a..663bf68 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -145,7 +145,7 @@ test_expect_success GPG 'detect fudged signature' '
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 $(cat forged1.commit) &&
git show --pretty=short --show-signature $(cat forged1.commit) >actual1 &&
grep "BAD signature from" actual1 &&
! grep "Good signature from" actual1
@@ -156,7 +156,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 $(cat forged2.commit) &&
git show --pretty=short --show-signature $(cat forged2.commit) >actual2 &&
grep "BAD signature from" actual2 &&
! grep "Good signature from" actual2