commit-graph: test --split across alternate without --split

We allow sharing commit-graph files across alternates. When we are writing a split commit-graph, we allow adding tip graph files that are not in the alternate, but include commits from our local repo. However, if our alternate is not using the split commit-graph format, its file is at .git/objects/info/commit-graph and we are trying to write files in .git/objects/info/commit-graphs/graph-{hash}.graph. We already have logic to ensure we do not merge across alternate boundaries, but we also cannot have a commit-graph chain to our alternate if uses the old filename structure. Create a test that verifies we create a new split commit-graph with only one level and we do not modify the existing commit-graph in the alternate. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Jun 18, 2019 at 11:14 UTC a09c1301ce5986a374ab008b2125fa26a9bdd2fe
1 file changed +15
t/t5324-split-commit-graph.sh
+15
@@ -301,4 +301,19 @@ test_expect_success 'add octopus merge' '
301
302 graph_git_behavior 'graph exists' merge/octopus commits/12
303
304 +test_expect_success 'split across alternate where alternate is not split' '
305 + git commit-graph write --reachable &&
306 + test_path_is_file .git/objects/info/commit-graph &&
307 + cp .git/objects/info/commit-graph . &&
308 + git clone --no-hardlinks . alt-split &&
309 + (
310 + cd alt-split &&
311 + echo "$(pwd)"/../.git/objects >.git/objects/info/alternates &&
312 + test_commit 18 &&
313 + git commit-graph write --reachable --split &&
314 + test_line_count = 1 $graphdir/commit-graph-chain
315 + ) &&
316 + test_cmp commit-graph .git/objects/info/commit-graph
317 +'
318 +
319 test_done