| 780 | } |
| 781 | |
| 782 | struct commit *pop_most_recent_commit(struct prio_queue *queue, |
| 783 | unsigned int mark) |
| 784 | { |
| 785 | struct commit *ret = prio_queue_peek(queue); |
| 786 | int get_pending = 1; |
| 787 | struct commit_list *parents = ret->parents; |
| 788 | |
| 789 | while (parents) { |
| 790 | struct commit *commit = parents->item; |
| 791 | if (!repo_parse_commit(the_repository, commit) && !(commit->object.flags & mark)) { |
| 792 | commit->object.flags |= mark; |
| 793 | if (get_pending) |
| 794 | prio_queue_replace(queue, commit); |
| 795 | else |
| 796 | prio_queue_put(queue, commit); |
| 797 | get_pending = 0; |
| 798 | } |
| 799 | parents = parents->next; |
| 800 | } |
| 801 | if (get_pending) |
| 802 | prio_queue_get(queue); |
| 803 | return ret; |
| 804 | } |
| 805 | |
| 806 | static void clear_commit_marks_1(struct commit_list **plist, |
| 807 | struct commit *commit, unsigned int mark) |
no test coverage detected