Skip to content

Commit c5cd749

Browse files
peffgitster
authored andcommitted
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 9d2e330 (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 <[email protected]> Helped-by: Junio C Hamano <[email protected]> Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ec6c7b4 commit c5cd749

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

t/t5310-pack-bitmaps.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ has_any () {
2222

2323
test_expect_success 'setup repo with moderate-sized history' '
2424
test_commit_bulk --id=file 100 &&
25+
git branch -M second &&
2526
git checkout -b other HEAD~5 &&
2627
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) &&
2930
blob=$(echo tagged-blob | git hash-object -w --stdin) &&
3031
git tag tagged-blob $blob &&
3132
git config repack.writebitmaps true
@@ -63,8 +64,8 @@ rev_list_tests() {
6364
'
6465

6566
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 &&
6869
test_cmp expect actual
6970
'
7071

@@ -128,7 +129,7 @@ test_expect_success 'setup further non-bitmapped commits' '
128129
rev_list_tests 'partial bitmap'
129130

130131
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 &&
132133
git rev-parse HEAD >expect &&
133134
git --git-dir=clone.git rev-parse HEAD >actual &&
134135
test_cmp expect actual
@@ -230,7 +231,7 @@ test_expect_success 'full repack, reusing previous bitmaps' '
230231
'
231232

232233
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 &&
234235
git rev-parse HEAD >expect &&
235236
git --git-dir=clone.git rev-parse HEAD >actual &&
236237
test_cmp expect actual
@@ -349,7 +350,7 @@ test_expect_success 'truncated bitmap fails gracefully (ewah)' '
349350
git rev-list --use-bitmap-index --count --all >expect &&
350351
bitmap=$(ls .git/objects/pack/*.bitmap) &&
351352
test_when_finished "rm -f $bitmap" &&
352-
test_copy_bytes 512 <$bitmap >$bitmap.tmp &&
353+
test_copy_bytes 256 <$bitmap >$bitmap.tmp &&
353354
mv -f $bitmap.tmp $bitmap &&
354355
git rev-list --use-bitmap-index --count --all >actual 2>stderr &&
355356
test_cmp expect actual &&

0 commit comments

Comments
 (0)