Skip to content

Commit 0a866db

Browse files
committed
Merge branch 'ds/commit-graph-lockfile-fix'
"git merge-base" in 2.19-rc1 has performance regression when the (experimental) commit-graph feature is in use, which has been mitigated. * ds/commit-graph-lockfile-fix: commit: don't use generation numbers if not needed
2 parents ca676b9 + 091f4cf commit 0a866db

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

commit.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,9 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n,
874874
int i;
875875
uint32_t last_gen = GENERATION_NUMBER_INFINITY;
876876

877+
if (!min_generation)
878+
queue.compare = compare_commits_by_commit_date;
879+
877880
one->object.flags |= PARENT1;
878881
if (!n) {
879882
commit_list_append(one, &result);
@@ -891,7 +894,7 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n,
891894
struct commit_list *parents;
892895
int flags;
893896

894-
if (commit->generation > last_gen)
897+
if (min_generation && commit->generation > last_gen)
895898
BUG("bad generation skip %8x > %8x at %s",
896899
commit->generation, last_gen,
897900
oid_to_hex(&commit->object.oid));

0 commit comments

Comments
 (0)