Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-04-29 01:50:04 +0300
committerJunio C Hamano <gitster@pobox.com>2020-04-29 01:50:04 +0300
commit5b6864ca445e606bdd6dae607d3ee5f410da66fa (patch)
tree678130275ab282b480468163def1419fa42eb76b /send-pack.c
parent8f5dc5a4af3fa32bf9261b76b0f1146fd15b8643 (diff)
parentdfe1b7f19c04fd10e9bafce91bc1da0c18bbb194 (diff)
Merge branch 'jx/atomic-push'
"git push --atomic" used to show failures for refs that weren't even pushed, which has been corrected. * jx/atomic-push: transport-helper: new method reject_atomic_push() transport-helper: mark failure for atomic push send-pack: mark failure of atomic push properly t5543: never report what we do not push send-pack: fix inconsistent porcelain output
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/send-pack.c b/send-pack.c
index da4741ce4a..d1b7edc995 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -190,10 +190,8 @@ static int receive_status(struct packet_reader *reader, struct ref *refs)
if (reader->line[0] == 'o' && reader->line[1] == 'k')
hint->status = REF_STATUS_OK;
- else {
+ else
hint->status = REF_STATUS_REMOTE_REJECT;
- ret = -1;
- }
hint->remote_status = xstrdup_or_null(msg);
/* start our next search from the next ref */
hint = hint->next;
@@ -322,29 +320,6 @@ free_return:
return update_seen;
}
-
-static int atomic_push_failure(struct send_pack_args *args,
- struct ref *remote_refs,
- struct ref *failing_ref)
-{
- struct ref *ref;
- /* Mark other refs as failed */
- for (ref = remote_refs; ref; ref = ref->next) {
- if (!ref->peer_ref && !args->send_mirror)
- continue;
-
- switch (ref->status) {
- case REF_STATUS_EXPECTING_REPORT:
- ref->status = REF_STATUS_ATOMIC_PUSH_FAILED;
- continue;
- default:
- break; /* do nothing */
- }
- }
- return error("atomic push failed for ref %s. status: %d\n",
- failing_ref->name, failing_ref->status);
-}
-
#define NONCE_LEN_LIMIT 256
static void reject_invalid_nonce(const char *nonce, int len)
@@ -489,7 +464,10 @@ int send_pack(struct send_pack_args *args,
if (use_atomic) {
strbuf_release(&req_buf);
strbuf_release(&cap_buf);
- return atomic_push_failure(args, remote_refs, ref);
+ reject_atomic_push(remote_refs, args->send_mirror);
+ error("atomic push failed for ref %s. status: %d\n",
+ ref->name, ref->status);
+ return args->porcelain ? 0 : -1;
}
/* else fallthrough */
default: