p5310-pack-bitmaps.sh [plain text]
#!/bin/sh
test_description='Tests pack performance using bitmaps'
. ./perf-lib.sh
test_perf_large_repo
test_expect_success 'setup bitmap config' '
git config pack.writebitmaps true &&
git config pack.writebitmaphashcache true
'
test_perf 'repack to disk' '
git repack -ad
'
test_perf 'simulated clone' '
git pack-objects --stdout --all </dev/null >/dev/null
'
test_perf 'simulated fetch' '
have=$(git rev-list HEAD~100 -1) &&
{
echo HEAD &&
echo ^$have
} | git pack-objects --revs --stdout >/dev/null
'
test_expect_success 'create partial bitmap state' '
cutoff=$(git rev-list HEAD~100 -1) &&
orig_tip=$(git rev-parse HEAD) &&
rm -rf .git/logs .git/refs/* .git/packed-refs &&
git update-ref HEAD $cutoff &&
git repack -Ad &&
git update-ref HEAD $orig_tip
'
test_perf 'partial bitmap' '
git pack-objects --stdout --all </dev/null >/dev/null
'
test_done