]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5324-split-commit-graph.sh
Merge branch 'tb/commit-graph-split-strategy'
[thirdparty/git.git] / t / t5324-split-commit-graph.sh
index b8b208fc3da2df2aa85f3b7c52ed17ce85aab446..3378ec54cde39884d5dd6bad85b05bbc62d41e42 100755 (executable)
@@ -357,4 +357,34 @@ test_expect_success 'split across alternate where alternate is not split' '
        test_cmp commit-graph .git/objects/info/commit-graph
 '
 
+test_expect_success '--split=no-merge always writes an incremental' '
+       test_when_finished rm -rf a b &&
+       rm -rf $graphdir $infodir/commit-graph &&
+       git reset --hard commits/2 &&
+       git rev-list HEAD~1 >a &&
+       git rev-list HEAD >b &&
+       git commit-graph write --split --stdin-commits <a &&
+       git commit-graph write --split=no-merge --stdin-commits <b &&
+       test_line_count = 2 $graphdir/commit-graph-chain
+'
+
+test_expect_success '--split=replace replaces the chain' '
+       rm -rf $graphdir $infodir/commit-graph &&
+       git reset --hard commits/3 &&
+       git rev-list -1 HEAD~2 >a &&
+       git rev-list -1 HEAD~1 >b &&
+       git rev-list -1 HEAD >c &&
+       git commit-graph write --split=no-merge --stdin-commits <a &&
+       git commit-graph write --split=no-merge --stdin-commits <b &&
+       git commit-graph write --split=no-merge --stdin-commits <c &&
+       test_line_count = 3 $graphdir/commit-graph-chain &&
+       git commit-graph write --stdin-commits --split=replace <b &&
+       test_path_is_missing $infodir/commit-graph &&
+       test_path_is_file $graphdir/commit-graph-chain &&
+       ls $graphdir/graph-*.graph >graph-files &&
+       test_line_count = 1 graph-files &&
+       verify_chain_files_exist $graphdir &&
+       graph_read_expect 2
+'
+
 test_done