aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2016-06-17 19:38:59 -0400
committerJunio C Hamano <gitster@pobox.com>2016-06-17 17:03:57 -0700
commitefee9553a4f97b2ecd8f49be19606dd4cf7d9c28 (patch)
tree1d1e5054f8de93e8ce06ba356336153e557e293c /t
parent0581b546419627d4e82f7df8b195fa207ef42f6a (diff)
downloadgit-efee9553a4f97b2ecd8f49be19606dd4cf7d9c28.tar.gz
git-efee9553a4f97b2ecd8f49be19606dd4cf7d9c28.tar.xz
gpg-interface: check gpg signature creation status
When we create a signature, it may happen that gpg returns with "success" but not with an actual detached signature on stdout. Check for the correct signature creation status to catch these cases better. Really, --status-fd parsing is the only way to check gpg status reliably. We do the same for verify already. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7004-tag.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index f9b7d79af..8b0f71a2a 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1202,10 +1202,17 @@ test_expect_success GPG,RFC1991 \
# try to sign with bad user.signingkey
git config user.signingkey BobTheMouse
test_expect_success GPG \
- 'git tag -s fails if gpg is misconfigured' \
+ 'git tag -s fails if gpg is misconfigured (bad key)' \
'test_must_fail git tag -s -m tail tag-gpg-failure'
git config --unset user.signingkey
+# try to produce invalid signature
+test_expect_success GPG \
+ 'git tag -s fails if gpg is misconfigured (bad signature format)' \
+ 'test_config gpg.program echo &&
+ test_must_fail git tag -s -m tail tag-gpg-failure'
+
+
# try to verify without gpg:
rm -rf gpghome