@@ -4,64 +4,53 @@ test_description='Tests performance using midx bitmaps'
44. ./perf-lib.sh
55. " ${TEST_DIRECTORY} /perf/lib-bitmap.sh"
66
7- test_bitmap () {
8- local enabled=" $1 "
9-
10- test_expect_success " remove existing repo (lookup=$enabled )" '
11- rm -fr * .git
12- '
13-
14- test_perf_large_repo
15-
16- # we need to create the tag up front such that it is covered by the repack and
17- # thus by generated bitmaps.
18- test_expect_success ' create tags' '
19- git tag --message="tag pointing to HEAD" perf-tag HEAD
20- '
21-
22- test_expect_success " use lookup table: $enabled " '
23- git config pack.writeBitmapLookupTable ' " $enabled " '
24- '
25-
26- test_expect_success " start with bitmapped pack (lookup=$enabled )" '
27- git repack -adb
28- '
29-
30- test_perf " setup multi-pack index (lookup=$enabled )" '
31- git multi-pack-index write --bitmap
32- '
33-
34- test_expect_success " drop pack bitmap (lookup=$enabled )" '
35- rm -f .git/objects/pack/pack-*.bitmap
36- '
37-
38- test_full_bitmap
39-
40- test_expect_success " create partial bitmap state (lookup=$enabled )" '
41- # pick a commit to represent the repo tip in the past
42- cutoff=$(git rev-list HEAD~100 -1) &&
43- orig_tip=$(git rev-parse HEAD) &&
44-
45- # now pretend we have just one tip
46- rm -rf .git/logs .git/refs/* .git/packed-refs &&
47- git update-ref HEAD $cutoff &&
48-
49- # and then repack, which will leave us with a nice
50- # big bitmap pack of the "old" history, and all of
51- # the new history will be loose, as if it had been pushed
52- # up incrementally and exploded via unpack-objects
53- git repack -Ad &&
54- git multi-pack-index write --bitmap &&
55-
56- # and now restore our original tip, as if the pushes
57- # had happened
58- git update-ref HEAD $orig_tip
59- '
60-
61- test_partial_bitmap
62- }
63-
64- test_bitmap false
65- test_bitmap true
7+ test_expect_success " remove existing repo" '
8+ rm -fr * .git
9+ '
10+
11+ test_perf_large_repo
12+
13+ # we need to create the tag up front such that it is covered by the repack and
14+ # thus by generated bitmaps.
15+ test_expect_success ' create tags' '
16+ git tag --message="tag pointing to HEAD" perf-tag HEAD
17+ '
18+
19+ test_expect_success " start with bitmapped pack" '
20+ git repack -adb
21+ '
22+
23+ test_perf " setup multi-pack index" '
24+ git multi-pack-index write --bitmap
25+ '
26+
27+ test_expect_success " drop pack bitmap" '
28+ rm -f .git/objects/pack/pack-*.bitmap
29+ '
30+
31+ test_full_bitmap
32+
33+ test_expect_success " create partial bitmap state" '
34+ # pick a commit to represent the repo tip in the past
35+ cutoff=$(git rev-list HEAD~100 -1) &&
36+ orig_tip=$(git rev-parse HEAD) &&
37+
38+ # now pretend we have just one tip
39+ rm -rf .git/logs .git/refs/* .git/packed-refs &&
40+ git update-ref HEAD $cutoff &&
41+
42+ # and then repack, which will leave us with a nice
43+ # big bitmap pack of the "old" history, and all of
44+ # the new history will be loose, as if it had been pushed
45+ # up incrementally and exploded via unpack-objects
46+ git repack -Ad &&
47+ git multi-pack-index write --bitmap &&
48+
49+ # and now restore our original tip, as if the pushes
50+ # had happened
51+ git update-ref HEAD $orig_tip
52+ '
53+
54+ test_partial_bitmap
6655
6756test_done
0 commit comments