@matheusbsbs / matheus-bagliano / commits / 7f98428d4b
Fork 0

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>

Shawn O. Pearce committed Mar 2, 2008 at 21:34 UTC 7f98428d4beb24b564acbbfa779391467aab6f03
1 file changed +2 -5
builtin-fetch.c
+2 -5
@@ -509,7 +509,7 @@ static struct ref *find_non_local_tags(struct transport *transport)
509 static int do_fetch(struct transport *transport,
510 struct refspec *refs, int ref_count)
511 {
512 - struct ref *ref_map, *fetch_map;
512 + struct ref *ref_map;
513 struct ref *rm;
514 int autotags = (transport->remote->fetch_tags == 1);
515 if (transport->remote->fetch_tags == 2 && tags != TAGS_UNSET)
@@ -540,8 +540,7 @@ static int do_fetch(struct transport *transport,
540 free_refs(ref_map);
541 return 1;
542 }
543 -
544 - fetch_map = ref_map;
543 + free_refs(ref_map);
544
545 /* if neither --no-tags nor --tags was specified, do automated tag
546 * following ... */
@@ -554,8 +553,6 @@ static int do_fetch(struct transport *transport,
553 free_refs(ref_map);
554 }
555
557 - free_refs(fetch_map);
558 -
556 transport_disconnect(transport);
557
558 return 0;