From 4b796951ffca7c0aa9e05d62d6d16a3c689b7f25 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 11 Jul 2013 13:25:52 +0200 Subject: 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 6be915f..04712ac 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; } } } -- cgit v0.10.2-6-g49f6