]>
Commit | Line | Data |
---|---|---|
2dee8af6 SP |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2006 Shawn Pearce | |
4 | # | |
5 | ||
6 | test_description='mmap sliding window tests' | |
e75d2f7f ÆAB |
7 | |
8 | TEST_PASSES_SANITIZE_LEAK=true | |
2dee8af6 SP |
9 | . ./test-lib.sh |
10 | ||
11 | test_expect_success \ | |
12 | 'setup' \ | |
a48fcd83 | 13 | 'rm -f .git/index* && |
2dee8af6 SP |
14 | for i in a b c |
15 | do | |
16 | echo $i >$i && | |
c680668d | 17 | test-tool genrandom "$i" 32768 >>$i && |
5be60078 | 18 | git update-index --add $i || return 1 |
2dee8af6 | 19 | done && |
5be60078 | 20 | echo d >d && cat c >>d && git update-index --add d && |
046dec74 EP |
21 | tree=$(git write-tree) && |
22 | commit1=$(git commit-tree $tree </dev/null) && | |
5be60078 | 23 | git update-ref HEAD $commit1 && |
3604e7c5 | 24 | git repack -a -d && |
046dec74 EP |
25 | test "$(git count-objects)" = "0 objects, 0 kilobytes" && |
26 | pack1=$(ls .git/objects/pack/*.pack) && | |
2dee8af6 SP |
27 | test -f "$pack1"' |
28 | ||
29 | test_expect_success \ | |
30 | 'verify-pack -v, defaults' \ | |
5be60078 | 31 | 'git verify-pack -v "$pack1"' |
2dee8af6 SP |
32 | |
33 | test_expect_success \ | |
34 | 'verify-pack -v, packedGitWindowSize == 1 page' \ | |
5be60078 JH |
35 | 'git config core.packedGitWindowSize 512 && |
36 | git verify-pack -v "$pack1"' | |
2dee8af6 SP |
37 | |
38 | test_expect_success \ | |
39 | 'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' \ | |
5be60078 JH |
40 | 'git config core.packedGitWindowSize 512 && |
41 | git config core.packedGitLimit 512 && | |
42 | git verify-pack -v "$pack1"' | |
2dee8af6 SP |
43 | |
44 | test_expect_success \ | |
45 | 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \ | |
5be60078 JH |
46 | 'git config core.packedGitWindowSize 512 && |
47 | git config core.packedGitLimit 512 && | |
046dec74 | 48 | commit2=$(git commit-tree $tree -p $commit1 </dev/null) && |
5be60078 | 49 | git update-ref HEAD $commit2 && |
3604e7c5 | 50 | git repack -a -d && |
046dec74 EP |
51 | test "$(git count-objects)" = "0 objects, 0 kilobytes" && |
52 | pack2=$(ls .git/objects/pack/*.pack) && | |
a48fcd83 | 53 | test -f "$pack2" && |
2dee8af6 SP |
54 | test "$pack1" \!= "$pack2"' |
55 | ||
56 | test_expect_success \ | |
57 | 'verify-pack -v, defaults' \ | |
5be60078 JH |
58 | 'git config --unset core.packedGitWindowSize && |
59 | git config --unset core.packedGitLimit && | |
60 | git verify-pack -v "$pack2"' | |
2dee8af6 SP |
61 | |
62 | test_done |