| 3620 | } |
| 3621 | |
| 3622 | static void simplify_merges(struct rev_info *revs) |
| 3623 | { |
| 3624 | struct commit_list *list, *next; |
| 3625 | struct commit_list *yet_to_do, **tail; |
| 3626 | struct commit *commit; |
| 3627 | |
| 3628 | if (!revs->prune) |
| 3629 | return; |
| 3630 | |
| 3631 | /* feed the list reversed */ |
| 3632 | yet_to_do = NULL; |
| 3633 | for (list = revs->commits; list; list = next) { |
| 3634 | commit = list->item; |
| 3635 | next = list->next; |
| 3636 | /* |
| 3637 | * Do not free(list) here yet; the original list |
| 3638 | * is used later in this function. |
| 3639 | */ |
| 3640 | commit_list_insert(commit, &yet_to_do); |
| 3641 | } |
| 3642 | while (yet_to_do) { |
| 3643 | list = yet_to_do; |
| 3644 | yet_to_do = NULL; |
| 3645 | tail = &yet_to_do; |
| 3646 | while (list) { |
| 3647 | commit = pop_commit(&list); |
| 3648 | tail = simplify_one(revs, commit, tail); |
| 3649 | } |
| 3650 | } |
| 3651 | |
| 3652 | /* clean up the result, removing the simplified ones */ |
| 3653 | list = revs->commits; |
| 3654 | revs->commits = NULL; |
| 3655 | tail = &revs->commits; |
| 3656 | while (list) { |
| 3657 | struct merge_simplify_state *st; |
| 3658 | |
| 3659 | commit = pop_commit(&list); |
| 3660 | st = locate_simplify_state(revs, commit); |
| 3661 | if (st->simplified == commit) |
| 3662 | tail = &commit_list_insert(commit, tail)->next; |
| 3663 | } |
| 3664 | } |
| 3665 | |
| 3666 | static void set_children(struct rev_info *revs) |
| 3667 | { |
no test coverage detected