summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-29 19:38:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-29 19:38:16 (GMT)
commit1a27b78e34e9d9685f6bd55e80b8199f4874ad11 (patch)
tree86ecf99beb017a279566ece53806259f32b491af /transport-helper.c
parent0c47e8ddf5e6584fe8baf8d25b2bcc4ca4c9cb5d (diff)
parent2581ea3d31a178df6b073226f0ee0ab5b3ca3a24 (diff)
downloadgit-1a27b78e34e9d9685f6bd55e80b8199f4874ad11.zip
git-1a27b78e34e9d9685f6bd55e80b8199f4874ad11.tar.gz
git-1a27b78e34e9d9685f6bd55e80b8199f4874ad11.tar.bz2
Merge branch 'es/local-atomic-push-failure-with-http' into maint
"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 c7e17ec..6b05a88 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: