Skip to content

Commit d087046

Browse files
committed
Merge branch 'jk/pack-idx-corruption-safety'
A flaky test has been corrected. * jk/pack-idx-corruption-safety: t5313: make extended-table test more deterministic
2 parents b9a7d55 + 7c2115a commit d087046

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

t/t5313-pack-bounds-checks.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,13 @@ test_expect_success 'bogus offset into v2 extended table' '
139139
test_expect_success 'bogus offset inside v2 extended table' '
140140
# We need two objects here, so we can plausibly require
141141
# an extended table (if the first object were larger than 2^31).
142-
do_pack "$object $(git rev-parse HEAD)" --index-version=2 &&
142+
#
143+
# Note that the value is important here. We want $object as
144+
# the second entry in sorted-sha1 order. The sha1 of 1485 starts
145+
# with "000", which sorts before that of $object (which starts
146+
# with "fff").
147+
second=$(echo 1485 | git hash-object -w --stdin) &&
148+
do_pack "$object $second" --index-version=2 &&
143149
144150
# We have to make extra room for the table, so we cannot
145151
# just munge in place as usual.

0 commit comments

Comments
 (0)