Skip to content

Commit 49ac1d3

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 953aa54 commit 49ac1d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t5316-pack-delta-depth.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ test_expect_success 'create series of packs' '
6969
max_chain() {
7070
git index-pack --verify-stat-only "$1" >output &&
7171
perl -lne '
72+
BEGIN { $len = 0 }
7273
/chain length = (\d+)/ and $len = $1;
7374
END { print $len }
7475
' output
@@ -94,4 +95,11 @@ test_expect_success '--depth limits depth' '
9495
test_cmp expect actual
9596
'
9697

98+
test_expect_success '--depth=0 disables deltas' '
99+
pack=$(git pack-objects --all --depth=0 </dev/null pack) &&
100+
echo 0 >expect &&
101+
max_chain pack-$pack.pack >actual &&
102+
test_cmp expect actual
103+
'
104+
97105
test_done

0 commit comments

Comments
 (0)