diff options
Diffstat (limited to 't/t5316-pack-delta-depth.sh')
-rwxr-xr-x | t/t5316-pack-delta-depth.sh | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh index 0f06c40eb1..759169d074 100755 --- a/t/t5316-pack-delta-depth.sh +++ b/t/t5316-pack-delta-depth.sh @@ -69,6 +69,7 @@ test_expect_success 'create series of packs' ' max_chain() { git index-pack --verify-stat-only "$1" >output && perl -lne ' + BEGIN { $len = 0 } /chain length = (\d+)/ and $len = $1; END { print $len } ' output @@ -84,14 +85,28 @@ test_expect_success 'packing produces a long delta' ' pack=$(git pack-objects --all --window=0 </dev/null pack) && echo 9 >expect && max_chain pack-$pack.pack >actual && - test_i18ncmp expect actual + test_cmp expect actual ' test_expect_success '--depth limits depth' ' pack=$(git pack-objects --all --depth=5 </dev/null pack) && echo 5 >expect && max_chain pack-$pack.pack >actual && - test_i18ncmp expect actual + test_cmp expect actual +' + +test_expect_success '--depth=0 disables deltas' ' + pack=$(git pack-objects --all --depth=0 </dev/null pack) && + echo 0 >expect && + max_chain pack-$pack.pack >actual && + test_cmp expect actual +' + +test_expect_success 'negative depth disables deltas' ' + pack=$(git pack-objects --all --depth=-1 </dev/null pack) && + echo 0 >expect && + max_chain pack-$pack.pack >actual && + test_cmp expect actual ' test_done |