diff options
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/transport.c b/transport.c index 08bcd3a4eb..eca9b8c817 100644 --- a/transport.c +++ b/transport.c @@ -117,7 +117,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list) return; } - if (hexval(buffer[0]) > 0xf) + if (!isxdigit(buffer[0])) continue; len = strlen(buffer); if (len && buffer[len - 1] == '\n') @@ -519,7 +519,7 @@ static int fetch_refs_via_pack(struct transport *transport, int nr_heads, struct ref **to_fetch) { struct git_transport_data *data = transport->data; - const struct ref *refs; + struct ref *refs; char *dest = xstrdup(transport->url); struct fetch_pack_args args; struct ref *refs_tmp = NULL; @@ -552,15 +552,17 @@ static int fetch_refs_via_pack(struct transport *transport, &transport->pack_lockfile); close(data->fd[0]); close(data->fd[1]); - if (finish_connect(data->conn)) + if (finish_connect(data->conn)) { + free_refs(refs); refs = NULL; + } data->conn = NULL; data->got_remote_heads = 0; data->options.self_contained_and_connected = args.self_contained_and_connected; free_refs(refs_tmp); - + free_refs(refs); free(dest); return (refs ? 0 : -1); } @@ -728,6 +730,10 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i ref->deletion ? NULL : ref->peer_ref, "remote failed to report status", porcelain); break; + case REF_STATUS_ATOMIC_PUSH_FAILED: + print_ref_status('!', "[rejected]", ref, ref->peer_ref, + "atomic push failed", porcelain); + break; case REF_STATUS_OK: print_ok_ref_status(ref, porcelain); break; @@ -826,6 +832,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re args.dry_run = !!(flags & TRANSPORT_PUSH_DRY_RUN); args.porcelain = !!(flags & TRANSPORT_PUSH_PORCELAIN); args.push_cert = !!(flags & TRANSPORT_PUSH_CERT); + args.atomic = !!(flags & TRANSPORT_PUSH_ATOMIC); args.url = transport->url; ret = send_pack(&args, data->fd, data->conn, remote_refs, |