]> git.ipfire.org Git - thirdparty/git.git/blob - t/perf/p5326-multi-pack-bitmaps.sh
clone: allow "--bare" with "-o"
[thirdparty/git.git] / t / perf / p5326-multi-pack-bitmaps.sh
1 #!/bin/sh
2
3 test_description='Tests performance using midx bitmaps'
4 . ./perf-lib.sh
5 . "${TEST_DIRECTORY}/perf/lib-bitmap.sh"
6
7 test_perf_large_repo
8
9 # we need to create the tag up front such that it is covered by the repack and
10 # thus by generated bitmaps.
11 test_expect_success 'create tags' '
12 git tag --message="tag pointing to HEAD" perf-tag HEAD
13 '
14
15 test_expect_success 'start with bitmapped pack' '
16 git repack -adb
17 '
18
19 test_perf 'setup multi-pack index' '
20 git multi-pack-index write --bitmap
21 '
22
23 test_expect_success 'drop pack bitmap' '
24 rm -f .git/objects/pack/pack-*.bitmap
25 '
26
27 test_full_bitmap
28
29 test_expect_success 'create partial bitmap state' '
30 # pick a commit to represent the repo tip in the past
31 cutoff=$(git rev-list HEAD~100 -1) &&
32 orig_tip=$(git rev-parse HEAD) &&
33
34 # now pretend we have just one tip
35 rm -rf .git/logs .git/refs/* .git/packed-refs &&
36 git update-ref HEAD $cutoff &&
37
38 # and then repack, which will leave us with a nice
39 # big bitmap pack of the "old" history, and all of
40 # the new history will be loose, as if it had been pushed
41 # up incrementally and exploded via unpack-objects
42 git repack -Ad &&
43 git multi-pack-index write --bitmap &&
44
45 # and now restore our original tip, as if the pushes
46 # had happened
47 git update-ref HEAD $orig_tip
48 '
49
50 test_partial_bitmap
51
52 test_done