summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-25 20:59:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-25 20:59:22 (GMT)
commitf87ee7fd47b180544b755c6e772edf74989bfabb (patch)
tree902b28f17207f664726c804fd4195cfd6a86c449 /transport.c
parentedefaa55bf202c2d676a0d48545a3720e58d4135 (diff)
parent2581ea3d31a178df6b073226f0ee0ab5b3ca3a24 (diff)
downloadgit-f87ee7fd47b180544b755c6e772edf74989bfabb.zip
git-f87ee7fd47b180544b755c6e772edf74989bfabb.tar.gz
git-f87ee7fd47b180544b755c6e772edf74989bfabb.tar.bz2
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.c')
-rw-r--r--transport.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/transport.c b/transport.c
index 2def5a0..778c60b 100644
--- a/transport.c
+++ b/transport.c
@@ -1226,6 +1226,20 @@ int transport_push(struct repository *r,
err = push_had_errors(remote_refs);
ret = push_ret | err;
+ if ((flags & TRANSPORT_PUSH_ATOMIC) && err) {
+ struct ref *it;
+ for (it = remote_refs; it; it = it->next)
+ switch (it->status) {
+ case REF_STATUS_NONE:
+ case REF_STATUS_UPTODATE:
+ case REF_STATUS_OK:
+ it->status = REF_STATUS_ATOMIC_PUSH_FAILED;
+ break;
+ default:
+ break;
+ }
+ }
+
if (!quiet || err)
transport_print_push_status(transport->url, remote_refs,
verbose | porcelain, porcelain,