upload-pack: remove a piece of dead code
Commit 682c7d2 (upload-pack: fix off-by-one depth calculation in shallow clone) introduced a new check in get_shallow_commits to decide when to stop traversing the history and mark the current commit as a shallow root. With this new check in place, the old check can no longer be true, since the first check always fires first. This commit removes that check, making the code a bit more simple again. Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl> Acked-by: Duy Nguyen <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthijs Kooijman committed
Jul 11, 2013 at 13:25 UTC
4b796951ffca7c0aa9e05d62d6d16a3c689b7f25
1 file changed
+6
-11
shallow.c
+6
-11
@@ -91,17 +91,12 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
91
continue;
92
*pointer = cur_depth;
93
}
94
- if (cur_depth < depth) {
95
- if (p->next)
96
- add_object_array(&p->item->object,
97
- NULL, &stack);
98
- else {
99
- commit = p->item;
100
- cur_depth = *(int *)commit->util;
101
- }
102
- } else {
103
- commit_list_insert(p->item, &result);
104
- p->item->object.flags |= shallow_flag;
94
+ if (p->next)
95
+ add_object_array(&p->item->object,
96
+ NULL, &stack);
97
+ else {
98
+ commit = p->item;
99
+ cur_depth = *(int *)commit->util;
100
}
101
}
102
}