summaryrefslogtreecommitdiff
path: root/t/t5324-split-commit-graph.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-05-01 13:39:52 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-05-01 13:39:52 -0700
commit6a1c17d05b0e67fa5f9661f492f407b984496b27 (patch)
tree2abe4b8ae7cb8eb78e93ca07cd1e9426a876297d /t/t5324-split-commit-graph.sh
parentMerge branch 'tb/reset-shallow' (diff)
parentRevert "commit-graph.c: introduce '--[no-]check-oids'" (diff)
downloadtgif-6a1c17d05b0e67fa5f9661f492f407b984496b27.tar.xz
Merge branch 'tb/commit-graph-split-strategy'
"git commit-graph write" learned different ways to write out split files. * tb/commit-graph-split-strategy: Revert "commit-graph.c: introduce '--[no-]check-oids'" commit-graph.c: introduce '--[no-]check-oids' commit-graph.h: replace 'commit_hex' with 'commits' oidset: introduce 'oidset_size' builtin/commit-graph.c: introduce split strategy 'replace' builtin/commit-graph.c: introduce split strategy 'no-merge' builtin/commit-graph.c: support for '--split[=<strategy>]' t/helper/test-read-graph.c: support commit-graph chains
Diffstat (limited to 't/t5324-split-commit-graph.sh')
-rwxr-xr-xt/t5324-split-commit-graph.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh
index b8b208fc3d..3378ec54cd 100755
--- a/t/t5324-split-commit-graph.sh
+++ b/t/t5324-split-commit-graph.sh
@@ -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