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

[PATCH 2/5] Don't bother passing ref log details to walker in builtin-fetch

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 15, 2007, 07:23 UTC
Message-ID
<20070915072304.GB20346@spearce.org>

When using the walker API within builtin-fetch we don't allow it to update refs locally; instead that action is reserved for builtin-fetch's own main loop once the objects have actually been downloaded.

Passing NULL here will bypass the unnecessary malloc/free of a string buffer within the walker API. That buffer is never used because the prior argument (the refs to update) is also NULL.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 transport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/transport.c b/transport.c
index 0338ed4..0021190 100644
--- a/transport.c
+++ b/transport.c
@@ -26,7 +26,7 @@ static int fetch_objs_via_walker(struct transport *transport,
 	for (i = 0; i < nr_objs; i++)
 		objs[i] = xstrdup(sha1_to_hex(to_fetch[i]->old_sha1));
 
-	if (walker_fetch(walker, nr_objs, objs, NULL, dest))
+	if (walker_fetch(walker, nr_objs, objs, NULL, NULL))
 		die("Fetch failed.");
 
 	for (i = 0; i < nr_objs; i++)
-- 
1.5.3.1.84.gaf82-dirty
Message 1 of 1 in “Don't bother passing ref log details to walker in builtin-fetch”
  1. 2/5 Don't bother passing ref log details to walker in builtin-fetchShawn O. Pearce, Sep 15, 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.