summaryrefslogtreecommitdiff
path: root/t/t5324-split-commit-graph.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5324-split-commit-graph.sh')
-rwxr-xr-xt/t5324-split-commit-graph.sh34
1 files changed, 31 insertions, 3 deletions
diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh
index 269d0964a3..4d3842b83b 100755
--- a/t/t5324-split-commit-graph.sh
+++ b/t/t5324-split-commit-graph.sh
@@ -12,13 +12,15 @@ test_expect_success 'setup repo' '
git config gc.writeCommitGraph false &&
infodir=".git/objects/info" &&
graphdir="$infodir/commit-graphs" &&
- test_oid_init &&
test_oid_cache <<-EOM
shallow sha1:1760
shallow sha256:2064
base sha1:1376
base sha256:1496
+
+ oid_version sha1:1
+ oid_version sha256:2
EOM
'
@@ -29,7 +31,7 @@ graph_read_expect() {
NUM_BASE=$2
fi
cat >expect <<- EOF
- header: 43475048 1 1 3 $NUM_BASE
+ header: 43475048 1 $(test_oid oid_version) 3 $NUM_BASE
num_commits: $1
chunks: oid_fanout oid_lookup commit_metadata
EOF
@@ -399,7 +401,7 @@ test_expect_success ULIMIT_FILE_DESCRIPTORS 'handles file descriptor exhaustion'
for i in $(test_seq 64)
do
test_commit $i &&
- test_might_fail run_with_limited_open_files git commit-graph write \
+ run_with_limited_open_files test_might_fail git commit-graph write \
--split=no-merge --reachable || return 1
done
)
@@ -425,4 +427,30 @@ done <<\EOF
0600 -r--------
EOF
+test_expect_success '--split=replace with partial Bloom data' '
+ 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 commit-graph write --split=no-merge --stdin-commits --changed-paths <a &&
+ git commit-graph write --split=no-merge --stdin-commits <b &&
+ git commit-graph write --split=replace --stdin-commits --changed-paths <c &&
+ ls $graphdir/graph-*.graph >graph-files &&
+ test_line_count = 1 graph-files &&
+ verify_chain_files_exist $graphdir
+'
+
+test_expect_success 'prevent regression for duplicate commits across layers' '
+ git init dup &&
+ git -C dup commit --allow-empty -m one &&
+ git -C dup -c core.commitGraph=false commit-graph write --split=no-merge --reachable 2>err &&
+ test_i18ngrep "attempting to write a commit-graph" err &&
+ git -C dup commit-graph write --split=no-merge --reachable &&
+ git -C dup commit --allow-empty -m two &&
+ git -C dup commit-graph write --split=no-merge --reachable &&
+ git -C dup commit --allow-empty -m three &&
+ git -C dup commit-graph write --split --reachable &&
+ git -C dup commit-graph verify
+'
+
test_done