Merge branch 'pj/remote-set-branches-usage-fix' into maint
[gitweb.git] / t / t7510-signed-commit.sh
index 30401ced071c24aed5071442da1a9674bc7b7c7e..1d3c56fe61fa995e9bfe2d3a1e4a9fef2c211387 100755 (executable)
@@ -24,7 +24,8 @@ test_expect_success GPG 'create signed commits' '
        echo 4 >file && test_tick && git commit -a -m "fourth unsigned" &&
        git tag fourth-unsigned &&
 
-       test_tick && git commit --amend -S -m "fourth signed"
+       test_tick && git commit --amend -S -m "fourth signed" &&
+       git tag fourth-signed
 '
 
 test_expect_success GPG 'show signatures' '
@@ -68,4 +69,12 @@ test_expect_success GPG 'detect fudged signature with NUL' '
        ! grep "Good signature from" actual2
 '
 
+test_expect_success GPG 'amending already signed commit' '
+       git checkout fourth-signed^0 &&
+       git commit --amend -S --no-edit &&
+       git show -s --show-signature HEAD >actual &&
+       grep "Good signature from" actual &&
+       ! grep "BAD signature from" actual
+'
+
 test_done