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

[PATCH] fetch: do not redundantly calculate tag refmap

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Nov 11, 2016, 00:13 UTC
Message-ID
<1478823208-10647-1-git-send-email-jonathantanmy@google.com>

builtin/fetch.c redundantly calculates refmaps for tags twice. Remove the first calculation.

This is only a code simplification and slight performance improvement - the result is unchanged, as the redundant refmaps are subsequently removed by the invocation to "ref_remove_duplicates" anyway.

This was introduced in commit c5a84e9 ("fetch --tags: fetch tags *in addition to* other stuff", 2013-10-29) when modifying the effect of the --tags parameter to "git fetch". The refmap-for-tag calculation was copied instead of moved.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
(I noticed this when working on something in this file.)
 builtin/fetch.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index b6a5597..1d77e58 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -359,9 +359,6 @@ static struct ref *get_ref_map(struct transport *transport,
 
 		for (i = 0; i < fetch_refspec_nr; i++)
 			get_fetch_map(ref_map, &fetch_refspec[i], &oref_tail, 1);
-
-		if (tags == TAGS_SET)
-			get_fetch_map(remote_refs, tag_refspec, &tail, 0);
 	} else if (refmap_array) {
 		die("--refmap option is only meaningful with command-line refspec(s).");
 	} else {
-- 
2.8.0.rc3.226.g39d4020
Next: Jeff King
Message 1 of 2 in “fetch: do not redundantly calculate tag refmap”
  1. fetch: do not redundantly calculate tag refmapJonathan Tan, Nov 11, 2016
  2. Jeff KingNov 11, 2016

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.