@matheusbsbs / matheus-bagliano / commits / abef3a1625
Fork 0

Shallow clone: do not ignore shallowness when following tags

Tags should be considered when truncating the commit list. The patch below fixes it, and fetches the right number of commits for each tag. However the correct fix is probably to not fetch historical tags at all. Signed-off-by: Junio C Hamano <junkio@cox.net>

Alexandre Julliard committed Nov 11, 2006 at 14:57 UTC abef3a1625b7aff168a5fa062432dc6ef2006963
1 file changed +2 -1
shallow.c
+2 -1
@@ -1,5 +1,6 @@
1 #include "cache.h"
2 #include "commit.h"
3 +#include "tag.h"
4
5 static int is_shallow = -1;
6
@@ -54,7 +55,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
55 if (!commit) {
56 if (i < heads->nr) {
57 commit = (struct commit *)
57 - heads->objects[i++].item;
58 + deref_tag(heads->objects[i++].item, NULL, 0);
59 if (commit->object.type != OBJ_COMMIT) {
60 commit = NULL;
61 continue;