summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-20 22:39:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-20 22:39:48 (GMT)
commit07301eaa766efac7818eac7a4a6db0d0c3948d66 (patch)
treee8d278300591713f61fbdcc5213dedb7d742c0f2 /transport.c
parentbd0d1916de221425fc22b69940ff71b0ce6aad9c (diff)
parentc1ceea1d273925fe6ecb0824e7ea08eb6e6e2635 (diff)
downloadgit-07301eaa766efac7818eac7a4a6db0d0c3948d66.zip
git-07301eaa766efac7818eac7a4a6db0d0c3948d66.tar.gz
git-07301eaa766efac7818eac7a4a6db0d0c3948d66.tar.bz2
Merge branch 'tr/http-push-ref-status'
* tr/http-push-ref-status: transport-helper.c::push_refs(): emit "no refs" error message transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed transport.c::transport_push(): make ref status affect return value refactor ref status logic for pushing t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs t5541-http-push.sh: add tests for non-fast-forward pushes Conflicts: transport-helper.c
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/transport.c b/transport.c
index c3f156e..d7db294 100644
--- a/transport.c
+++ b/transport.c
@@ -983,7 +983,7 @@ int transport_push(struct transport *transport,
int verbose = flags & TRANSPORT_PUSH_VERBOSE;
int quiet = flags & TRANSPORT_PUSH_QUIET;
int porcelain = flags & TRANSPORT_PUSH_PORCELAIN;
- int ret;
+ int ret, err;
if (flags & TRANSPORT_PUSH_ALL)
match_flags |= MATCH_REFS_ALL;
@@ -995,9 +995,16 @@ int transport_push(struct transport *transport,
return -1;
}
+ set_ref_status_for_push(remote_refs,
+ flags & TRANSPORT_PUSH_MIRROR,
+ flags & TRANSPORT_PUSH_FORCE);
+
ret = transport->push_refs(transport, remote_refs, flags);
+ err = push_had_errors(remote_refs);
+
+ ret |= err;
- if (!quiet || push_had_errors(remote_refs))
+ if (!quiet || err)
print_push_status(transport->url, remote_refs,
verbose | porcelain, porcelain,
nonfastforward);