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

[PATCH 06/11] git-fetch: Release objects used by a prior transport

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 9, 2007, 11:06 UTC
Message-ID
<20071109110626.GF19368@spearce.org>

Some transports allocate objects in the internal object hashtable during the fetch process (e.g. the HTTP commit walker and also the native protocol). These shouldn't be visible to another transport call running in the same fetch process when we fetch the tags during automated tag following. By deallocating the object table (if it has anything in it) we ensure the second transport execution will be from a clean slate.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 builtin-fetch.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 847db73..18f123e 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -337,7 +337,10 @@ static void store_updated_refs(const char *url, struct ref *ref_map)
 
 static int fetch_refs(struct transport *transport, struct ref *ref_map)
 {
-	int ret = transport_fetch_refs(transport, ref_map);
+	int ret;
+
+	free_all_objects();
+	ret = transport_fetch_refs(transport, ref_map);
 	if (!ret)
 		store_updated_refs(transport->url, ref_map);
 	transport_unlock_pack(transport);
-- 
1.5.3.5.1622.g41d10
Next: Junio C Hamano
Message 1 of 3 in “git-fetch: Release objects used by a prior transport”
  1. 06/11 git-fetch: Release objects used by a prior transportShawn O. Pearce, Nov 9, 2007
  2. Junio C HamanoNov 9, 2007
  3. Shawn O. PearceNov 11, 2007

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.