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