From 58e28af6a4d4d4faa1fa628e91c0b33c2b87aade Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Sat, 23 Apr 2005 20:29:22 -0700 Subject: [PATCH] Allow multiple date-ordered lists Make pop_most_recent_commit() return the same objects multiple times, but only if called with different bits to mark. This is necessary to make merge-base work again. Signed-Off-By: Daniel Barkalow Signed-off-by: Linus Torvalds --- commit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'commit.c') diff --git a/commit.c b/commit.c index 0243e77cb8..2502688262 100644 --- a/commit.c +++ b/commit.c @@ -114,7 +114,8 @@ void sort_by_date(struct commit_list **list) *list = ret; } -struct commit *pop_most_recent_commit(struct commit_list **list) +struct commit *pop_most_recent_commit(struct commit_list **list, + unsigned int mark) { struct commit *ret = (*list)->item; struct commit_list *parents = ret->parents; @@ -125,8 +126,9 @@ struct commit *pop_most_recent_commit(struct commit_list **list) while (parents) { struct commit *commit = parents->item; - if (!commit->object.parsed) { - parse_commit(commit); + parse_commit(commit); + if (!(commit->object.flags & mark)) { + commit->object.flags |= mark; insert_by_date(list, commit); } parents = parents->next; -- cgit v1.2.1