tree-wide: apply equals-null.cocci
[alt-git.git] / t / perf / p5310-pack-bitmaps.sh
blob7ad4f237bc37ff0547bcd036cbbfc160cf723a4f
1 #!/bin/sh
3 test_description='Tests pack performance using bitmaps'
4 . ./perf-lib.sh
5 . "${TEST_DIRECTORY}/perf/lib-bitmap.sh"
7 test_perf_large_repo
9 # note that we do everything through config,
10 # since we want to be able to compare bitmap-aware
11 # git versus non-bitmap git
13 # We intentionally use the deprecated pack.writebitmaps
14 # config so that we can test against older versions of git.
15 test_expect_success 'setup bitmap config' '
16 git config pack.writebitmaps true
19 # we need to create the tag up front such that it is covered by the repack and
20 # thus by generated bitmaps.
21 test_expect_success 'create tags' '
22 git tag --message="tag pointing to HEAD" perf-tag HEAD
25 test_perf 'repack to disk' '
26 git repack -ad
29 test_full_bitmap
31 test_expect_success 'create partial bitmap state' '
32 # pick a commit to represent the repo tip in the past
33 cutoff=$(git rev-list HEAD~100 -1) &&
34 orig_tip=$(git rev-parse HEAD) &&
36 # now kill off all of the refs and pretend we had
37 # just the one tip
38 rm -rf .git/logs .git/refs/* .git/packed-refs &&
39 git update-ref HEAD $cutoff &&
41 # and then repack, which will leave us with a nice
42 # big bitmap pack of the "old" history, and all of
43 # the new history will be loose, as if it had been pushed
44 # up incrementally and exploded via unpack-objects
45 git repack -Ad &&
47 # and now restore our original tip, as if the pushes
48 # had happened
49 git update-ref HEAD $orig_tip
52 test_partial_bitmap
54 test_done