use parse_commit_or_die instead of custom message
[gitweb.git] / shallow.c
index cbe2526d8c2b2643957eea2729a16269a7a74fab..a273685e75098440548b78c6445c1f2efeb0ad2b 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -89,8 +89,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
                                cur_depth = *(int *)commit->util;
                        }
                }
-               if (parse_commit(commit))
-                       die("invalid commit");
+               parse_commit_or_die(commit);
                cur_depth++;
                if (cur_depth >= depth) {
                        commit_list_insert(commit, &result);
@@ -110,17 +109,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;
                        }
                }
        }