3 # Copyright (c) 2006 Shawn Pearce
6 test_description
='mmap sliding window tests'
8 TEST_PASSES_SANITIZE_LEAK
=true
11 test_expect_success
'setup' '
16 test-tool genrandom "$i" 32768 >>$i &&
17 git update-index --add $i || return 1
19 echo d >d && cat c >>d && git update-index --add d &&
20 tree=$(git write-tree) &&
21 commit1=$(git commit-tree $tree </dev/null) &&
22 git update-ref HEAD $commit1 &&
24 test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
25 pack1=$(ls .git/objects/pack/*.pack) &&
29 test_expect_success
'verify-pack -v, defaults' '
30 git verify-pack -v "$pack1"
33 test_expect_success
'verify-pack -v, packedGitWindowSize == 1 page' '
34 git config core.packedGitWindowSize 512 &&
35 git verify-pack -v "$pack1"
38 test_expect_success
'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' '
39 git config core.packedGitWindowSize 512 &&
40 git config core.packedGitLimit 512 &&
41 git verify-pack -v "$pack1"
44 test_expect_success
'repack -a -d, packedGit{WindowSize,Limit} == 1 page' '
45 git config core.packedGitWindowSize 512 &&
46 git config core.packedGitLimit 512 &&
47 commit2=$(git commit-tree $tree -p $commit1 </dev/null) &&
48 git update-ref HEAD $commit2 &&
50 test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
51 pack2=$(ls .git/objects/pack/*.pack) &&
53 test "$pack1" \!= "$pack2"
56 test_expect_success
'verify-pack -v, defaults' '
57 git config --unset core.packedGitWindowSize &&
58 git config --unset core.packedGitLimit &&
59 git verify-pack -v "$pack2"