X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-fetch.c;h=1348a0e952fd2ff7ad9b05995c030708e6045723;hb=7f98428d4beb24b564acbbfa779391467aab6f03;hp=320e235682340f07cb28b0a4de0c39b6bd9da383;hpb=a41acc63badf20cbb22cca61039dca9309deaa19;p=git.git diff --git a/builtin-fetch.c b/builtin-fetch.c index 320e23568..1348a0e95 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -452,8 +452,7 @@ static int add_existing(const char *refname, const unsigned char *sha1, return 0; } -static struct ref *find_non_local_tags(struct transport *transport, - struct ref *fetch_map) +static struct ref *find_non_local_tags(struct transport *transport) { static struct path_list existing_refs = { NULL, 0, 0, 0 }; struct path_list new_refs = { NULL, 0, 0, 1 }; @@ -510,7 +509,7 @@ static struct ref *find_non_local_tags(struct transport *transport, static int do_fetch(struct transport *transport, struct refspec *refs, int ref_count) { - struct ref *ref_map, *fetch_map; + struct ref *ref_map; struct ref *rm; int autotags = (transport->remote->fetch_tags == 1); if (transport->remote->fetch_tags == 2 && tags != TAGS_UNSET) @@ -541,13 +540,12 @@ static int do_fetch(struct transport *transport, free_refs(ref_map); return 1; } - - fetch_map = ref_map; + free_refs(ref_map); /* if neither --no-tags nor --tags was specified, do automated tag * following ... */ if (tags == TAGS_DEFAULT && autotags) { - ref_map = find_non_local_tags(transport, fetch_map); + ref_map = find_non_local_tags(transport); if (ref_map) { transport_set_option(transport, TRANS_OPT_DEPTH, "0"); fetch_refs(transport, ref_map); @@ -555,7 +553,7 @@ static int do_fetch(struct transport *transport, free_refs(ref_map); } - free_refs(fetch_map); + transport_disconnect(transport); return 0; }