From: Matthijs Kooijman Date: Thu, 11 Jul 2013 11:25:52 +0000 (+0200) Subject: upload-pack: remove a piece of dead code X-Git-Tag: v1.8.4-rc0~23^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4b796951ffca7c0aa9e05d62d6d16a3c689b7f25;p=thirdparty%2Fgit.git 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 Acked-by: Duy Nguyen Signed-off-by: Junio C Hamano --- diff --git a/shallow.c b/shallow.c index 6be915f38f..04712ac25e 100644 --- a/shallow.c +++ b/shallow.c @@ -91,17 +91,12 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth, continue; *pointer = cur_depth; } - if (cur_depth < depth) { - if (p->next) - add_object_array(&p->item->object, - NULL, &stack); - else { - commit = p->item; - cur_depth = *(int *)commit->util; - } - } else { - commit_list_insert(p->item, &result); - p->item->object.flags |= shallow_flag; + if (p->next) + add_object_array(&p->item->object, + NULL, &stack); + else { + commit = p->item; + cur_depth = *(int *)commit->util; } } }