summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-25 22:25:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-25 22:25:41 (GMT)
commitb5847b9fab0aedc3b2642ccd123da7dd95da1376 (patch)
tree6cc105e9c34f79bd3dbce0b49d2120a084ed8b41 /t
parent407d9145213a03f53861d5b6d1337e65a7f8661b (diff)
parenta4f324a423ddfe3680bf6105f8c113d0e76305a0 (diff)
downloadgit-b5847b9fab0aedc3b2642ccd123da7dd95da1376.zip
git-b5847b9fab0aedc3b2642ccd123da7dd95da1376.tar.gz
git-b5847b9fab0aedc3b2642ccd123da7dd95da1376.tar.bz2
Merge branch 'hx/push-atomic-with-cert'
"git push" that wants to be atomic and wants to send push certificate learned not to prepare and sign the push certificate when it fails the local check (hence due to atomicity it is known that no certificate is needed). * hx/push-atomic-with-cert: send-pack: run GPG after atomic push checking
Diffstat (limited to 't')
-rwxr-xr-xt/t5534-push-signed.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh
index 030331f..7e928af 100755
--- a/t/t5534-push-signed.sh
+++ b/t/t5534-push-signed.sh
@@ -273,4 +273,27 @@ test_expect_success GPGSM 'fail without key and heed user.signingkey x509' '
test_cmp expect dst/push-cert-status
'
+test_expect_success GPG 'failed atomic push does not execute GPG' '
+ prepare_dst &&
+ git -C dst config receive.certnonceseed sekrit &&
+ write_script gpg <<-EOF &&
+ # should check atomic push locally before running GPG.
+ exit 1
+ EOF
+ test_must_fail env PATH="$TRASH_DIRECTORY:$PATH" git push \
+ --signed --atomic --porcelain \
+ dst noop ff noff >out 2>&1 &&
+
+ test_i18ngrep ! "gpg failed to sign" out &&
+ sed -n -e "/^To dst/,$ p" out >actual &&
+ cat >expect <<-EOF &&
+ To dst
+ = refs/heads/noop:refs/heads/noop [up to date]
+ ! refs/heads/ff:refs/heads/ff [rejected] (atomic push failed)
+ ! refs/heads/noff:refs/heads/noff [rejected] (non-fast-forward)
+ Done
+ EOF
+ test_i18ncmp expect actual
+'
+
test_done