aboutsummaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2010-01-08 10:12:43 +0800
committerJunio C Hamano <gitster@pobox.com>2010-01-09 23:34:10 -0800
commit4232826771d5bdc4cc0bd21188b6ee5f3e700a52 (patch)
tree2e314c980e28f780943de81b8aeb618b77766a24 /transport.c
parent20e8b465a53e651cc3f50bd60f39d577ecdb7722 (diff)
downloadgit-4232826771d5bdc4cc0bd21188b6ee5f3e700a52.tar.gz
git-4232826771d5bdc4cc0bd21188b6ee5f3e700a52.tar.xz
transport.c::transport_push(): make ref status affect return value
Use push_had_errors() to check the refs for errors and modify the return value. Mark the non-fast-forward push tests to succeed. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/transport.c b/transport.c
index 12c4423f7..9b2398911 100644
--- a/transport.c
+++ b/transport.c
@@ -875,7 +875,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;
@@ -892,8 +892,11 @@ int transport_push(struct transport *transport,
flags & TRANSPORT_PUSH_FORCE);
ret = transport->push_refs(transport, remote_refs, flags);
+ err = push_had_errors(remote_refs);
- if (!quiet || push_had_errors(remote_refs))
+ ret |= err;
+
+ if (!quiet || err)
print_push_status(transport->url, remote_refs,
verbose | porcelain, porcelain,
nonfastforward);