summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-09-25 15:25:41 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-09-25 15:25:41 -0700
commitb5847b9fab0aedc3b2642ccd123da7dd95da1376 (patch)
tree6cc105e9c34f79bd3dbce0b49d2120a084ed8b41 /t
parentMerge branch 'rs/misc-cleanups' (diff)
parentsend-pack: run GPG after atomic push checking (diff)
downloadtgif-b5847b9fab0aedc3b2642ccd123da7dd95da1376.tar.xz
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 030331f1c5..7e928aff66 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