summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2020-12-08 17:03:28 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-12-08 14:48:15 -0800
commitc5cd7490762b20cdec3844e99cfc908c38917906 (patch)
tree5918954ef1f28c3a5b9af7c52eaca8241a836901 /t
parentpack-bitmap: bounds-check size of cache extension (diff)
downloadtgif-c5cd7490762b20cdec3844e99cfc908c38917906.tar.xz
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t5310-pack-bitmaps.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index e2c3907a68..cdebcd79b6 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -22,10 +22,11 @@ has_any () {
test_expect_success 'setup repo with moderate-sized history' '
test_commit_bulk --id=file 100 &&
+ git branch -M second &&
git checkout -b other HEAD~5 &&
test_commit_bulk --id=side 10 &&
- git checkout master &&
- bitmaptip=$(git rev-parse master) &&
+ git checkout second &&
+ bitmaptip=$(git rev-parse second) &&
blob=$(echo tagged-blob | git hash-object -w --stdin) &&
git tag tagged-blob $blob &&
git config repack.writebitmaps true
@@ -63,8 +64,8 @@ rev_list_tests() {
'
test_expect_success "counting non-linear history ($state)" '
- git rev-list --count other...master >expect &&
- git rev-list --use-bitmap-index --count other...master >actual &&
+ git rev-list --count other...second >expect &&
+ git rev-list --use-bitmap-index --count other...second >actual &&
test_cmp expect actual
'
@@ -128,7 +129,7 @@ test_expect_success 'setup further non-bitmapped commits' '
rev_list_tests 'partial bitmap'
test_expect_success 'fetch (partial bitmap)' '
- git --git-dir=clone.git fetch origin master:master &&
+ git --git-dir=clone.git fetch origin second:second &&
git rev-parse HEAD >expect &&
git --git-dir=clone.git rev-parse HEAD >actual &&
test_cmp expect actual
@@ -230,7 +231,7 @@ test_expect_success 'full repack, reusing previous bitmaps' '
'
test_expect_success 'fetch (full bitmap)' '
- git --git-dir=clone.git fetch origin master:master &&
+ git --git-dir=clone.git fetch origin second:second &&
git rev-parse HEAD >expect &&
git --git-dir=clone.git rev-parse HEAD >actual &&
test_cmp expect actual
@@ -349,7 +350,7 @@ test_expect_success 'truncated bitmap fails gracefully (ewah)' '
git rev-list --use-bitmap-index --count --all >expect &&
bitmap=$(ls .git/objects/pack/*.bitmap) &&
test_when_finished "rm -f $bitmap" &&
- test_copy_bytes 512 <$bitmap >$bitmap.tmp &&
+ test_copy_bytes 256 <$bitmap >$bitmap.tmp &&
mv -f $bitmap.tmp $bitmap &&
git rev-list --use-bitmap-index --count --all >actual 2>stderr &&
test_cmp expect actual &&