From: Alexandre Julliard Date: Fri, 24 Nov 2006 15:00:13 +0000 (+0100) Subject: fetch-pack: Do not fetch tags for shallow clones. X-Git-Tag: v1.5.0-rc1~172^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4bcb310c2539b66d535e87508d1b7a90fe29c083;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/fetch-pack.c b/fetch-pack.c index bb310b644..80979b83b 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -342,7 +342,8 @@ static void filter_refs(struct ref **refs, int nr_match, char **match) if (!memcmp(ref->name, "refs/", 5) && check_ref_format(ref->name + 5)) ; /* trash */ - else if (fetch_all) { + else if (fetch_all && + (!depth || strncmp(ref->name, "refs/tags/", 10) )) { *newtail = ref; ref->next = NULL; newtail = &ref->next;