diff options
-rw-r--r-- | src/revwalk.c | 57 |
1 files changed, 6 insertions, 51 deletions
diff --git a/src/revwalk.c b/src/revwalk.c index 5bccb5c3a..6a1033009 100644 --- a/src/revwalk.c +++ b/src/revwalk.c @@ -457,53 +457,6 @@ static void mark_parents_uninteresting(git_commit_list_node *commit) } } -static int premark_uninteresting(git_revwalk *walk) -{ - int error = 0; - unsigned short i; - git_pqueue q; - git_commit_list *list; - git_commit_list_node *commit, *parent; - - if ((error = git_pqueue_init(&q, 0, 8, git_commit_list_time_cmp)) < 0) - return error; - - for (list = walk->user_input; list; list = list->next) { - if ((error = git_commit_list_parse(walk, list->item)) < 0) - goto cleanup; - - if (list->item->uninteresting) - mark_parents_uninteresting(list->item); - - if ((error = git_pqueue_insert(&q, list->item)) < 0) - goto cleanup; - } - - while (interesting(&q)) { - commit = git_pqueue_pop(&q); - - for (i = 0; i < commit->out_degree; i++) { - parent = commit->parents[i]; - - if ((error = git_commit_list_parse(walk, parent)) < 0) - goto cleanup; - - if (commit->uninteresting) - parent->uninteresting = 1; - - if (contains(&q, parent)) - continue; - - if ((error = git_pqueue_insert(&q, parent)) < 0) - goto cleanup; - } - } - -cleanup: - git_pqueue_free(&q); - return error; -} - static int prepare_walk(git_revwalk *walk) { int error; @@ -516,15 +469,17 @@ static int prepare_walk(git_revwalk *walk) return GIT_ITEROVER; } - if (walk->did_hide && (error = premark_uninteresting(walk)) < 0) - return error; - for (list = walk->user_input; list; list = list->next) { + if ((error = git_commit_list_parse(walk, list->item)) < 0) + return error; + + if (list->item->uninteresting) + mark_parents_uninteresting(list->item); + if (process_commit(walk, list->item, list->item->uninteresting) < 0) return -1; } - if (walk->sorting & GIT_SORT_TOPOLOGICAL) { unsigned short i; |