Skip to content

Commit 6cc823c

Browse files
jonathantanmygitster
authored andcommitted
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 <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0b65a8d commit 6cc823c

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

builtin/fetch.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,6 @@ static struct ref *get_ref_map(struct transport *transport,
347347

348348
for (i = 0; i < fetch_refspec_nr; i++)
349349
get_fetch_map(ref_map, &fetch_refspec[i], &oref_tail, 1);
350-
351-
if (tags == TAGS_SET)
352-
get_fetch_map(remote_refs, tag_refspec, &tail, 0);
353350
} else if (refmap_array) {
354351
die("--refmap option is only meaningful with command-line refspec(s).");
355352
} else {

0 commit comments

Comments
 (0)