git-rebase--merge.sh: use the $( ... ) construct for command substitution
[git/mingw.git] / t / perf / p5310-pack-bitmaps.sh
blob685d46f8b75ae105d41e1b462c69f980fe1f61a8
1 #!/bin/sh
3 test_description='Tests pack performance using bitmaps'
4 . ./perf-lib.sh
6 test_perf_large_repo
8 # note that we do everything through config,
9 # since we want to be able to compare bitmap-aware
10 # git versus non-bitmap git
11 test_expect_success 'setup bitmap config' '
12 git config pack.writebitmaps true &&
13 git config pack.writebitmaphashcache true
16 test_perf 'repack to disk' '
17 git repack -ad
20 test_perf 'simulated clone' '
21 git pack-objects --stdout --all </dev/null >/dev/null
24 test_perf 'simulated fetch' '
25 have=$(git rev-list HEAD~100 -1) &&
27 echo HEAD &&
28 echo ^$have
29 } | git pack-objects --revs --stdout >/dev/null
32 test_expect_success 'create partial bitmap state' '
33 # pick a commit to represent the repo tip in the past
34 cutoff=$(git rev-list HEAD~100 -1) &&
35 orig_tip=$(git rev-parse HEAD) &&
37 # now kill off all of the refs and pretend we had
38 # just the one tip
39 rm -rf .git/logs .git/refs/* .git/packed-refs
40 git update-ref HEAD $cutoff
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
48 # and now restore our original tip, as if the pushes
49 # had happened
50 git update-ref HEAD $orig_tip
53 test_perf 'partial bitmap' '
54 git pack-objects --stdout --all </dev/null >/dev/null
57 test_done