diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2013-07-11 13:25:52 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-15 10:49:42 -0700 |
commit | 4b796951ffca7c0aa9e05d62d6d16a3c689b7f25 (patch) | |
tree | 3ed9fdedd170b50f828953a42df5ac51929fdd8e /shallow.c | |
parent | 2532d891a4aab003a5ce19f04509fd8549754485 (diff) | |
download | git-4b796951ffca7c0aa9e05d62d6d16a3c689b7f25.tar.gz |
upload-pack: remove a piece of dead codemk/upload-pack-off-by-one-dead-code-removal
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>
Diffstat (limited to 'shallow.c')
-rw-r--r-- | shallow.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -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; } } } |