aboutsummaryrefslogtreecommitdiffstats
path: root/send-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-18 15:30:32 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-18 15:30:32 -0800
commit345aaf3976a6abc491026c8a465b5e8ccbc8da5a (patch)
treeed05fb25aad1b568206963db3bbf10ee15affd3a /send-pack.c
parente565f3755342caf1d21e22359eaf09ec11d8c0ae (diff)
parentb81f8c8dd3ec81a8d622e2d3d6b2af426ca53f05 (diff)
downloadgit-345aaf3976a6abc491026c8a465b5e8ccbc8da5a.tar.gz
Merge branch 'ps/send-pack-unhide-error-in-atomic-push'
"git push --atomic --porcelain" used to ignore failures from the other side, losing the error status from the child process, which has been corrected. * ps/send-pack-unhide-error-in-atomic-push: send-pack: gracefully close the connection for atomic push t5543: atomic push reports exit code failure send-pack: new return code "ERROR_SEND_PACK_BAD_REF_STATUS" t5548: add porcelain push test cases for dry-run mode t5548: add new porcelain test cases t5548: refactor test cases by resetting upstream t5548: refactor to reuse setup_upstream() function t5504: modernize test by moving heredocs into test bodies
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/send-pack.c b/send-pack.c
index 772c7683a0..856a65d5f5 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -632,7 +632,8 @@ int send_pack(struct repository *r,
reject_atomic_push(remote_refs, args->send_mirror);
error("atomic push failed for ref %s. status: %d",
ref->name, ref->status);
- ret = args->porcelain ? 0 : -1;
+ ret = ERROR_SEND_PACK_BAD_REF_STATUS;
+ packet_flush(out);
goto out;
}
/* else fallthrough */
@@ -763,11 +764,6 @@ int send_pack(struct repository *r,
if (ret < 0)
goto out;
- if (args->porcelain) {
- ret = 0;
- goto out;
- }
-
for (ref = remote_refs; ref; ref = ref->next) {
switch (ref->status) {
case REF_STATUS_NONE:
@@ -775,7 +771,7 @@ int send_pack(struct repository *r,
case REF_STATUS_OK:
break;
default:
- ret = -1;
+ ret = ERROR_SEND_PACK_BAD_REF_STATUS;
goto out;
}
}