]> git.ipfire.org Git - thirdparty/git.git/blob - t/perf/p5310-pack-bitmaps.sh
clone: allow "--bare" with "-o"
[thirdparty/git.git] / t / perf / p5310-pack-bitmaps.sh
1 #!/bin/sh
2
3 test_description='Tests pack performance using bitmaps'
4 . ./perf-lib.sh
5 . "${TEST_DIRECTORY}/perf/lib-bitmap.sh"
6
7 test_perf_large_repo
8
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
12 #
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
17 '
18
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
23 '
24
25 test_perf 'repack to disk' '
26 git repack -ad
27 '
28
29 test_full_bitmap
30
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) &&
35
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 &&
40
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 &&
46
47 # and now restore our original tip, as if the pushes
48 # had happened
49 git update-ref HEAD $orig_tip
50 '
51
52 test_partial_bitmap
53
54 test_done