Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-05-01 17:04:00 +0300
committerJunio C Hamano <gitster@pobox.com>2021-05-03 08:29:56 +0300
commit49ac1d33bbd9d4be4ad8cb9730a07c086f688a5b (patch)
tree20a53d65a9474ac01b3a9e20479dac70392939af /t/t5316-pack-delta-depth.sh
parent953aa54e1a6a7571d48eddea3ee68745bf94e69d (diff)
t5316: check behavior of pack-objects --depth=0
We'd expect this to cleanly produce no deltas at all (as opposed to getting confused by an out-of-bounds value), and it does. Note we have to adjust our max_chain test helper, which expected to find at least one delta. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5316-pack-delta-depth.sh')
-rwxr-xr-xt/t5316-pack-delta-depth.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh
index a8c1bc0f66..3e84df4137 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
@@ -94,4 +95,11 @@ test_expect_success '--depth limits depth' '
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_done