Skip to content

Commit 3bcedae

Browse files
committed
Merge branch 'ds/commit-graph-octopus-fix'
commit-graph did not handle commits with more than two parents correctly, which has been corrected. * ds/commit-graph-octopus-fix: commit-graph: fix bug around octopus merges
2 parents 7c20df8 + a35bea4 commit 3bcedae

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

commit-graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
16361636
num_parents++;
16371637

16381638
if (num_parents > 2)
1639-
ctx->num_extra_edges += num_parents - 2;
1639+
ctx->num_extra_edges += num_parents - 1;
16401640
}
16411641
}
16421642

t/t5324-split-commit-graph.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ test_expect_success 'add octopus merge' '
319319
git merge commits/3 commits/4 &&
320320
git branch merge/octopus &&
321321
git commit-graph write --reachable --split &&
322-
git commit-graph verify &&
322+
git commit-graph verify 2>err &&
323+
test_line_count = 3 err &&
324+
test_i18ngrep ! warning err &&
323325
test_line_count = 3 $graphdir/commit-graph-chain
324326
'
325327

0 commit comments

Comments
 (0)