t5310: drop size of truncated ewah bitmap

We truncate the .bitmap file to 512 bytes and expect to run into problems reading an individual ewah file. But this length is somewhat arbitrary, and just happened to work when the test was added in 9d2e330b17 (ewah_read_mmap: bounds-check mmap reads, 2018-06-14). An upcoming commit will change the size of the history we create in the test repo, which will cause this test to fail. We can future-proof it a bit more by reducing the size of the truncated bitmap file. Signed-off-by: Jeff King <peff@peff.net> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Dec 8, 2020 at 17:03 UTC c5cd7490762b20cdec3844e99cfc908c38917906
1 file changed +8 -7
t/t5310-pack-bitmaps.sh
+8 -7
@@ -22,10 +22,11 @@ has_any () {
22
23 test_expect_success 'setup repo with moderate-sized history' '
24 test_commit_bulk --id=file 100 &&
25 + git branch -M second &&
26 git checkout -b other HEAD~5 &&
27 test_commit_bulk --id=side 10 &&
27 - git checkout master &&
28 - bitmaptip=$(git rev-parse master) &&
28 + git checkout second &&
29 + bitmaptip=$(git rev-parse second) &&
30 blob=$(echo tagged-blob | git hash-object -w --stdin) &&
31 git tag tagged-blob $blob &&
32 git config repack.writebitmaps true
@@ -63,8 +64,8 @@ rev_list_tests() {
64 '
65
66 test_expect_success "counting non-linear history ($state)" '
66 - git rev-list --count other...master >expect &&
67 - git rev-list --use-bitmap-index --count other...master >actual &&
67 + git rev-list --count other...second >expect &&
68 + git rev-list --use-bitmap-index --count other...second >actual &&
69 test_cmp expect actual
70 '
71
@@ -128,7 +129,7 @@ test_expect_success 'setup further non-bitmapped commits' '
129 rev_list_tests 'partial bitmap'
130
131 test_expect_success 'fetch (partial bitmap)' '
131 - git --git-dir=clone.git fetch origin master:master &&
132 + git --git-dir=clone.git fetch origin second:second &&
133 git rev-parse HEAD >expect &&
134 git --git-dir=clone.git rev-parse HEAD >actual &&
135 test_cmp expect actual
@@ -230,7 +231,7 @@ test_expect_success 'full repack, reusing previous bitmaps' '
231 '
232
233 test_expect_success 'fetch (full bitmap)' '
233 - git --git-dir=clone.git fetch origin master:master &&
234 + git --git-dir=clone.git fetch origin second:second &&
235 git rev-parse HEAD >expect &&
236 git --git-dir=clone.git rev-parse HEAD >actual &&
237 test_cmp expect actual
@@ -349,7 +350,7 @@ test_expect_success 'truncated bitmap fails gracefully (ewah)' '
350 git rev-list --use-bitmap-index --count --all >expect &&
351 bitmap=$(ls .git/objects/pack/*.bitmap) &&
352 test_when_finished "rm -f $bitmap" &&
352 - test_copy_bytes 512 <$bitmap >$bitmap.tmp &&
353 + test_copy_bytes 256 <$bitmap >$bitmap.tmp &&
354 mv -f $bitmap.tmp $bitmap &&
355 git rev-list --use-bitmap-index --count --all >actual 2>stderr &&
356 test_cmp expect actual &&