[PATCH 5/5] fetch-pack: Do not fetch tags for shallow clones.

Subsystems: the rest

STALE3681d

2 messages, 2 authors, 2016-08-11 · open the first message on its own page

[PATCH 5/5] fetch-pack: Do not fetch tags for shallow clones.

From: Alexandre Julliard <hidden>
Date: 2016-08-11 20:38:57

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 <redacted>
---
 fetch-pack.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index bb310b6..80979b8 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -342,7 +342,8 @@ static void filter_refs(struct ref **ref
 		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;
-- 
1.4.4.1.ga335e

-- 
Alexandre Julliard

Re: [PATCH 5/5] fetch-pack: Do not fetch tags for shallow clones.

From: Johannes Schindelin <hidden>
Date: 2016-08-11 20:44:46

Hi,

the other 4 patches look good to me (fixing a few typos/thinkos). However, 
I think there must be a way to fetch tags for clones, when it is possible 
for fetches. Especially since fetch gets closer to including the features 
needed for "clone" (regexes for remote names, storing packs, ...)

Ciao,
Dscho

P.S.: I just realized that send-pack and receive-pack are not at all aware 
of shallow repos. Maybe both should check for a shallow repo, and die() on 
it?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help