aboutsummaryrefslogtreecommitdiffstats
path: root/object-name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-07-22 07:27:39 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-22 07:27:39 -0700
commitc7a5d9a13c53c91fd012aea7fbfdf05286cbf3d9 (patch)
tree70326abe19a3c7df4b81049f9b8910f05030fb9f /object-name.c
parentSync with 'master' (diff)
downloadgit-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 'object-name.c')
-rw-r--r--object-name.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/object-name.c b/object-name.c
index 41930609e3..ddafe7f9b1 100644
--- a/object-name.c
+++ b/object-name.c
@@ -28,7 +28,6 @@
#include "commit-reach.h"
#include "date.h"
#include "object-file-convert.h"
-#include "prio-queue.h"
static int get_oid_oneline(struct repository *r, const char *, struct object_id *,
const struct commit_list *);
@@ -1462,7 +1461,7 @@ static int get_oid_oneline(struct repository *r,
const char *prefix, struct object_id *oid,
const struct commit_list *list)
{
- struct prio_queue copy = { compare_commits_by_commit_date };
+ struct commit_list *copy = NULL, **copy_tail = &copy;
const struct commit_list *l;
int found = 0;
int negative = 0;
@@ -1484,9 +1483,9 @@ static int get_oid_oneline(struct repository *r,
for (l = list; l; l = l->next) {
l->item->object.flags |= ONELINE_SEEN;
- prio_queue_put(&copy, l->item);
+ copy_tail = &commit_list_insert(l->item, copy_tail)->next;
}
- while (copy.nr) {
+ while (copy) {
const char *p, *buf;
struct commit *commit;
int matches;
@@ -1508,7 +1507,7 @@ static int get_oid_oneline(struct repository *r,
regfree(&regex);
for (l = list; l; l = l->next)
clear_commit_marks(l->item, ONELINE_SEEN);
- clear_prio_queue(&copy);
+ free_commit_list(copy);
return found ? 0 : -1;
}
@@ -2062,6 +2061,7 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo,
cb.list = &list;
refs_for_each_ref(get_main_ref_store(repo), handle_one_ref, &cb);
refs_head_ref(get_main_ref_store(repo), handle_one_ref, &cb);
+ commit_list_sort_by_date(&list);
ret = get_oid_oneline(repo, name + 2, oid, list);
free_commit_list(list);