From 6cc823c5c15911b27a410cfd47abc81cc10c0003 Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Thu, 10 Nov 2016 16:13:28 -0800 Subject: fetch: do not redundantly calculate tag refmap 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 Reviewed-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/fetch.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'builtin') diff --git a/builtin/fetch.c b/builtin/fetch.c index e4639d8eb1..606364593e 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -347,9 +347,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 { -- cgit v1.2.3