]> git.ipfire.org Git - thirdparty/git.git/blob - t/t5315-pack-objects-compression.sh
The third batch
[thirdparty/git.git] / t / t5315-pack-objects-compression.sh
1 #!/bin/sh
2
3 test_description='pack-object compression configuration'
4
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 test_expect_success setup '
9 printf "%2000000s" X |
10 git hash-object -w --stdin >object-name &&
11 # make sure it resulted in a loose object
12 ob=$(sed -e "s/\(..\).*/\1/" object-name) &&
13 ject=$(sed -e "s/..\(.*\)/\1/" object-name) &&
14 test -f .git/objects/$ob/$ject
15 '
16
17 while read expect config
18 do
19 test_expect_success "pack-objects with $config" '
20 test_when_finished "rm -f pack-*.*" &&
21 git $config pack-objects pack <object-name &&
22 sz=$(test_file_size pack-*.pack) &&
23 case "$expect" in
24 small) test "$sz" -le 100000 ;;
25 large) test "$sz" -ge 100000 ;;
26 esac
27 '
28 done <<\EOF
29 large -c core.compression=0
30 small -c core.compression=9
31 large -c core.compression=0 -c pack.compression=0
32 large -c core.compression=9 -c pack.compression=0
33 small -c core.compression=0 -c pack.compression=9
34 small -c core.compression=9 -c pack.compression=9
35 large -c pack.compression=0
36 small -c pack.compression=9
37 EOF
38
39 test_done