diff --git a/commit-graph.c b/commit-graph.c index c91e6f0fb82158..1aaf02879b9d73 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -1629,7 +1629,7 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx) num_parents++; if (num_parents > 2) - ctx->num_extra_edges += num_parents - 2; + ctx->num_extra_edges += num_parents - 1; } } diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh index 03f45a1ed9023c..99f4ef4c19dff0 100755 --- a/t/t5324-split-commit-graph.sh +++ b/t/t5324-split-commit-graph.sh @@ -319,7 +319,9 @@ test_expect_success 'add octopus merge' ' git merge commits/3 commits/4 && git branch merge/octopus && git commit-graph write --reachable --split && - git commit-graph verify && + git commit-graph verify 2>err && + test_line_count = 3 err && + test_i18ngrep ! warning err && test_line_count = 3 $graphdir/commit-graph-chain '