Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-08-09 00:26:09 +0300
committerJunio C Hamano <gitster@pobox.com>2019-08-09 00:26:09 +0300
commit3bcedae27ea2af2e3895d92d6525231e350c91be (patch)
tree9bf2247236869d3f41bbd0b9a2df746fcc2ecf66
parent7c20df84bd21ec0215358381844274fa10515017 (diff)
parenta35bea40b674b21fbdb98d982e41c46d014ced83 (diff)
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
-rw-r--r--commit-graph.c2
-rwxr-xr-xt/t5324-split-commit-graph.sh4
2 files changed, 4 insertions, 2 deletions
diff --git a/commit-graph.c b/commit-graph.c
index b3c4de79b6..90fdee9256 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1636,7 +1636,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 03f45a1ed9..99f4ef4c19 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
'