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 /fetch-pack.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 'fetch-pack.c')
| -rw-r--r-- | fetch-pack.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index c1be9b76eb..01d3699c4b 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -34,7 +34,6 @@ #include "commit-graph.h" #include "sigchain.h" #include "mergesort.h" -#include "prio-queue.h" static int transfer_unpack_limit = -1; static int fetch_unpack_limit = -1; @@ -602,7 +601,7 @@ done: return count ? retval : 0; } -static struct prio_queue complete = { compare_commits_by_commit_date }; +static struct commit_list *complete; static int mark_complete(const struct object_id *oid) { @@ -610,7 +609,7 @@ static int mark_complete(const struct object_id *oid) if (commit && !(commit->object.flags & COMPLETE)) { commit->object.flags |= COMPLETE; - prio_queue_put(&complete, commit); + commit_list_insert(commit, &complete); } return 0; } @@ -627,12 +626,9 @@ static int mark_complete_oid(const char *refname UNUSED, static void mark_recent_complete_commits(struct fetch_pack_args *args, timestamp_t cutoff) { - while (complete.nr) { - struct commit *item = prio_queue_peek(&complete); - if (item->date < cutoff) - break; + while (complete && cutoff <= complete->item->date) { print_verbose(args, _("Marking %s as complete"), - oid_to_hex(&item->object.oid)); + oid_to_hex(&complete->item->object.oid)); pop_most_recent_commit(&complete, COMPLETE); } } @@ -802,6 +798,7 @@ static void mark_complete_and_common_ref(struct fetch_negotiator *negotiator, refs_for_each_rawref(get_main_ref_store(the_repository), mark_complete_oid, NULL); for_each_cached_alternate(NULL, mark_alternate_complete); + commit_list_sort_by_date(&complete); if (cutoff) mark_recent_complete_commits(args, cutoff); } |
