3 # Copyright (c) 2006 Shawn Pearce
6 test_description
='mmap sliding window tests'
10 perl
-e 'print pack("C", rand(256)) foreach 0 .. 32767'
19 test-genrandom "$i" 32768 >>$i &&
20 git update-index --add $i || return 1
22 echo d >d && cat c >>d && git update-index --add d &&
23 tree=`git write-tree` &&
24 commit1=`git commit-tree $tree </dev/null` &&
25 git update-ref HEAD $commit1 &&
27 test "`git count-objects`" = "0 objects, 0 kilobytes" &&
28 pack1=`ls .git/objects/pack/*.pack` &&
32 'verify-pack -v, defaults' \
33 'git verify-pack -v "$pack1"'
36 'verify-pack -v, packedGitWindowSize == 1 page' \
37 'git config core.packedGitWindowSize 512 &&
38 git verify-pack -v "$pack1"'
41 'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' \
42 'git config core.packedGitWindowSize 512 &&
43 git config core.packedGitLimit 512 &&
44 git verify-pack -v "$pack1"'
47 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \
48 'git config core.packedGitWindowSize 512 &&
49 git config core.packedGitLimit 512 &&
50 commit2=`git commit-tree $tree -p $commit1 </dev/null` &&
51 git update-ref HEAD $commit2 &&
53 test "`git count-objects`" = "0 objects, 0 kilobytes" &&
54 pack2=`ls .git/objects/pack/*.pack` &&
56 test "$pack1" \!= "$pack2"'
59 'verify-pack -v, defaults' \
60 'git config --unset core.packedGitWindowSize &&
61 git config --unset core.packedGitLimit &&
62 git verify-pack -v "$pack2"'