| 82 | static struct prio_queue complete = { compare_commits_by_commit_date }; |
| 83 | |
| 84 | static int process_commit(struct walker *walker, struct commit *commit) |
| 85 | { |
| 86 | struct commit_list *parents; |
| 87 | |
| 88 | if (repo_parse_commit(the_repository, commit)) |
| 89 | return -1; |
| 90 | |
| 91 | while (complete.nr) { |
| 92 | struct commit *item = prio_queue_peek(&complete); |
| 93 | if (item->date < commit->date) |
| 94 | break; |
| 95 | pop_most_recent_commit(&complete, COMPLETE); |
| 96 | } |
| 97 | |
| 98 | if (commit->object.flags & COMPLETE) |
| 99 | return 0; |
| 100 | |
| 101 | oidcpy(¤t_commit_oid, &commit->object.oid); |
| 102 | |
| 103 | walker_say(walker, "walk %s\n", oid_to_hex(&commit->object.oid)); |
| 104 | |
| 105 | if (process(walker, &repo_get_commit_tree(the_repository, commit)->object)) |
| 106 | return -1; |
| 107 | |
| 108 | for (parents = commit->parents; parents; parents = parents->next) { |
| 109 | if (process(walker, &parents->item->object)) |
| 110 | return -1; |
| 111 | } |
| 112 | |
| 113 | return 0; |
| 114 | } |
| 115 | |
| 116 | static int process_tag(struct walker *walker, struct tag *tag) |
| 117 | { |
no test coverage detected