fetch-pack: Do not fetch tags for shallow clones.
A better fix may be to only fetch tags that point to commits that we are downloading, but git-clone doesn't have support for following tags. This will happen automatically on the next git-fetch though. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Alexandre Julliard committed
Nov 24, 2006 at 16:00 UTC
4bcb310c2539b66d535e87508d1b7a90fe29c083
1 file changed
+2
-1
fetch-pack.c
+2
-1
@@ -342,7 +342,8 @@ static void filter_refs(struct ref **refs, int nr_match, char **match)
342
if (!memcmp(ref->name, "refs/", 5) &&
343
check_ref_format(ref->name + 5))
344
; /* trash */
345
- else if (fetch_all) {
345
+ else if (fetch_all &&
346
+ (!depth || strncmp(ref->name, "refs/tags/", 10) )) {
347
*newtail = ref;
348
ref->next = NULL;
349
newtail = &ref->next;