diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-07-22 07:27:39 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-22 07:27:39 -0700 |
| commit | c7a5d9a13c53c91fd012aea7fbfdf05286cbf3d9 (patch) | |
| tree | 70326abe19a3c7df4b81049f9b8910f05030fb9f /walker.c | |
| parent | Sync with 'master' (diff) | |
| download | git-c7a5d9a13c53c91fd012aea7fbfdf05286cbf3d9.tar.gz git-c7a5d9a13c53c91fd012aea7fbfdf05286cbf3d9.zip | |
Revert "Merge branch 'rs/pop-recent-commit-with-prio-queue' into next"
This reverts commit 03dce625bff6598e7f77d9f4a4a25d0288e5e5a8, reversing
changes made to 6ba607880dc2bbf7e13e5734880ce0f9b87d2670.
Diffstat (limited to 'walker.c')
| -rw-r--r-- | walker.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -14,7 +14,6 @@ #include "blob.h" #include "refs.h" #include "progress.h" -#include "prio-queue.h" static struct object_id current_commit_oid; @@ -79,7 +78,7 @@ static int process_tree(struct walker *walker, struct tree *tree) #define SEEN (1U << 1) #define TO_SCAN (1U << 2) -static struct prio_queue complete = { compare_commits_by_commit_date }; +static struct commit_list *complete = NULL; static int process_commit(struct walker *walker, struct commit *commit) { @@ -88,10 +87,7 @@ static int process_commit(struct walker *walker, struct commit *commit) if (repo_parse_commit(the_repository, commit)) return -1; - while (complete.nr) { - struct commit *item = prio_queue_peek(&complete); - if (item->date < commit->date) - break; + while (complete && complete->item->date >= commit->date) { pop_most_recent_commit(&complete, COMPLETE); } @@ -237,7 +233,7 @@ static int mark_complete(const char *path UNUSED, if (commit) { commit->object.flags |= COMPLETE; - prio_queue_put(&complete, commit); + commit_list_insert(commit, &complete); } return 0; } @@ -306,6 +302,7 @@ int walker_fetch(struct walker *walker, int targets, char **target, if (!walker->get_recover) { refs_for_each_ref(get_main_ref_store(the_repository), mark_complete, NULL); + commit_list_sort_by_date(&complete); } for (i = 0; i < targets; i++) { |
