summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-07-25 13:59:22 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-07-25 13:59:22 -0700
commitf87ee7fd47b180544b755c6e772edf74989bfabb (patch)
tree902b28f17207f664726c804fd4195cfd6a86c449 /transport-helper.c
parentMerge branch 'rm/gpg-program-doc-fix' (diff)
parenttransport-helper: avoid var decl in for () loop control (diff)
downloadtgif-f87ee7fd47b180544b755c6e772edf74989bfabb.tar.xz
Merge branch 'es/local-atomic-push-failure-with-http'
"git push --atomic" that goes over the transport-helper (namely, the smart http transport) failed to prevent refs to be pushed when it can locally tell that one of the ref update will fail without having to consult the other end, which has been corrected. * es/local-atomic-push-failure-with-http: transport-helper: avoid var decl in for () loop control transport-helper: enforce atomic in push_refs_with_push
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/transport-helper.c b/transport-helper.c
index c7e17ec9cb..6b05a88faf 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -853,6 +853,7 @@ static int push_refs_with_push(struct transport *transport,
{
int force_all = flags & TRANSPORT_PUSH_FORCE;
int mirror = flags & TRANSPORT_PUSH_MIRROR;
+ int atomic = flags & TRANSPORT_PUSH_ATOMIC;
struct helper_data *data = transport->data;
struct strbuf buf = STRBUF_INIT;
struct ref *ref;
@@ -872,6 +873,11 @@ static int push_refs_with_push(struct transport *transport,
case REF_STATUS_REJECT_NONFASTFORWARD:
case REF_STATUS_REJECT_STALE:
case REF_STATUS_REJECT_ALREADY_EXISTS:
+ if (atomic) {
+ string_list_clear(&cas_options, 0);
+ return 0;
+ } else
+ continue;
case REF_STATUS_UPTODATE:
continue;
default: