git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/7] Remove unnecessary delaying of free_refs(ref_map) in builtin-fetch

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 1, 2008, 05:24 UTC
Message-ID
<20080301052448.GB27300@spearce.org>

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);
Message 1 of 1 in “Remove unnecessary delaying of free_refs(ref_map) in builtin-fetch”
  1. 2/7 Remove unnecessary delaying of free_refs(ref_map) in builtin-fetchShawn O. Pearce, Mar 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.