verify-commit: add test for exit status on untrusted signature
verify-tag exits successfully if the signature is good but the key is untrusted. verify-commit exits unsuccessfully. This divergence in behavior is unexpected and unwanted. Since verify-tag existed earlier, add a failing test to have verify-commit share verify-tag's behavior. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Jun 21, 2015 at 23:14 UTC
8e98e5f27aba812c0f095b7e546871e14a4139f6
1 file changed
+7
t/t7510-signed-commit.sh
+7
@@ -81,6 +81,13 @@ test_expect_success GPG 'verify and show signatures' '
81
)
82
'
83
84
+test_expect_failure GPG 'verify-commit exits success on untrusted signature' '
85
+ git verify-commit eighth-signed-alt 2>actual &&
86
+ grep "Good signature from" actual &&
87
+ ! grep "BAD signature from" actual &&
88
+ grep "not certified" actual
89
+'
90
+
91
test_expect_success GPG 'show signed commit with signature' '
92
git show -s initial >commit &&
93
git show -s --show-signature initial >show &&