diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-03-25 12:54:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-25 12:54:25 -0700 |
commit | 2f6ef7138790d80c43024b132b15ad06daacf266 (patch) | |
tree | 3f7c9b2099a4c12051c4c94b6b36587b39433dab /transport.c | |
parent | 927936d75391a81250543c928fed620a2af98464 (diff) | |
parent | 32d0462f8da9cc4e26ca1e785098e2ae1bee4d02 (diff) | |
download | git-2f6ef7138790d80c43024b132b15ad06daacf266.tar.gz |
Merge branch 'jk/fetch-pack'
"git fetch" that fetches a commit using the allow-tip-sha1-in-want
extension could have failed to fetch all the requested refs.
* jk/fetch-pack:
fetch-pack: remove dead assignment to ref->new_sha1
fetch_refs_via_pack: free extra copy of refs
filter_ref: make a copy of extra "sought" entries
filter_ref: avoid overwriting ref->old_sha1 with garbage
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/transport.c b/transport.c index 00f39d9f5b..eca9b8c817 100644 --- a/transport.c +++ b/transport.c @@ -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); } |