Remove unnecessary delaying of free_refs(ref_map) in builtin-fetch
We can free this ref_map as soon as the fetch is complete. It is not used for the automatic tag following, nor is it used to disconnect the transport. This avoids some confusion about why we are holding onto these refs while following tags. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ff655a69df
commit
7f98428d4b
@ -509,7 +509,7 @@ static struct ref *find_non_local_tags(struct transport *transport)
|
|||||||
static int do_fetch(struct transport *transport,
|
static int do_fetch(struct transport *transport,
|
||||||
struct refspec *refs, int ref_count)
|
struct refspec *refs, int ref_count)
|
||||||
{
|
{
|
||||||
struct ref *ref_map, *fetch_map;
|
struct ref *ref_map;
|
||||||
struct ref *rm;
|
struct ref *rm;
|
||||||
int autotags = (transport->remote->fetch_tags == 1);
|
int autotags = (transport->remote->fetch_tags == 1);
|
||||||
if (transport->remote->fetch_tags == 2 && tags != TAGS_UNSET)
|
if (transport->remote->fetch_tags == 2 && tags != TAGS_UNSET)
|
||||||
@ -540,8 +540,7 @@ static int do_fetch(struct transport *transport,
|
|||||||
free_refs(ref_map);
|
free_refs(ref_map);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
free_refs(ref_map);
|
||||||
fetch_map = ref_map;
|
|
||||||
|
|
||||||
/* if neither --no-tags nor --tags was specified, do automated tag
|
/* if neither --no-tags nor --tags was specified, do automated tag
|
||||||
* following ... */
|
* following ... */
|
||||||
@ -554,8 +553,6 @@ static int do_fetch(struct transport *transport,
|
|||||||
free_refs(ref_map);
|
free_refs(ref_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
free_refs(fetch_map);
|
|
||||||
|
|
||||||
transport_disconnect(transport);
|
transport_disconnect(transport);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user