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
maint
Junio C Hamano 2019-08-08 14:26:09 -07:00
commit 3bcedae27e
2 changed files with 4 additions and 2 deletions

View File

@ -1636,7 +1636,7 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
num_parents++; num_parents++;


if (num_parents > 2) if (num_parents > 2)
ctx->num_extra_edges += num_parents - 2; ctx->num_extra_edges += num_parents - 1;
} }
} }



View File

@ -319,7 +319,9 @@ test_expect_success 'add octopus merge' '
git merge commits/3 commits/4 && git merge commits/3 commits/4 &&
git branch merge/octopus && git branch merge/octopus &&
git commit-graph write --reachable --split && 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 test_line_count = 3 $graphdir/commit-graph-chain
' '