git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 2/8] Remove unnecessary delaying of free_refs(ref_map) in builtin-fetch
@ 2008-03-03  2:34 Shawn O. Pearce
  0 siblings, 0 replies; only message in thread
From: Shawn O. Pearce @ 2008-03-03  2:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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>
---
 builtin-fetch.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/builtin-fetch.c b/builtin-fetch.c
index f8b9542..1348a0e 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -509,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)
@@ -540,8 +540,7 @@ 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 ... */
@@ -554,8 +553,6 @@ static int do_fetch(struct transport *transport,
 		free_refs(ref_map);
 	}
 
-	free_refs(fetch_map);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-03  2:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-03  2:34 [PATCH v3 2/8] Remove unnecessary delaying of free_refs(ref_map) in builtin-fetch Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).