Merge branch 'mk/upload-pack-off-by-one-dead-code-removal'
authorJunio C Hamano <gitster@pobox.com>
Mon, 22 Jul 2013 18:24:05 +0000 (11:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Jul 2013 18:24:05 +0000 (11:24 -0700)
* mk/upload-pack-off-by-one-dead-code-removal:
  upload-pack: remove a piece of dead code

shallow.c

index cbe2526..8a9c96d 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -110,17 +110,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;
                        }
                }
        }