aboutsummaryrefslogtreecommitdiffstats
path: root/transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/transport.c b/transport.c
index d6851dc475..6c2801bcbd 100644
--- a/transport.c
+++ b/transport.c
@@ -935,6 +935,13 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
case protocol_v0:
ret = send_pack(the_repository, &args, data->fd, data->conn, remote_refs,
&data->extra_have);
+ /*
+ * Ignore the specific error code to maintain consistent behavior
+ * with the "push_refs()" function across different transports,
+ * such as "push_refs_with_push()" for HTTP protocol.
+ */
+ if (ret == ERROR_SEND_PACK_BAD_REF_STATUS)
+ ret = 0;
break;
case protocol_unknown_version:
BUG("unknown protocol version");
@@ -942,15 +949,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
close(data->fd[1]);
close(data->fd[0]);
- /*
- * Atomic push may abort the connection early and close the pipe,
- * which may cause an error for `finish_connect()`. Ignore this error
- * for atomic git-push.
- */
- if (ret || args.atomic)
- finish_connect(data->conn);
- else
- ret = finish_connect(data->conn);
+ ret |= finish_connect(data->conn);
data->conn = NULL;
data->finished_handshake = 0;