t1092: stress test 'git sparse-checkout set'
[git/debian.git] / t / t5315-pack-objects-compression.sh
blob8bacd96275b0ac881b9202ecaff83394ca562dd2
1 #!/bin/sh
3 test_description='pack-object compression configuration'
5 . ./test-lib.sh
7 test_expect_success setup '
8 printf "%2000000s" X |
9 git hash-object -w --stdin >object-name &&
10 # make sure it resulted in a loose object
11 ob=$(sed -e "s/\(..\).*/\1/" object-name) &&
12 ject=$(sed -e "s/..\(.*\)/\1/" object-name) &&
13 test -f .git/objects/$ob/$ject
16 while read expect config
18 test_expect_success "pack-objects with $config" '
19 test_when_finished "rm -f pack-*.*" &&
20 git $config pack-objects pack <object-name &&
21 sz=$(test_file_size pack-*.pack) &&
22 case "$expect" in
23 small) test "$sz" -le 100000 ;;
24 large) test "$sz" -ge 100000 ;;
25 esac
27 done <<\EOF
28 large -c core.compression=0
29 small -c core.compression=9
30 large -c core.compression=0 -c pack.compression=0
31 large -c core.compression=9 -c pack.compression=0
32 small -c core.compression=0 -c pack.compression=9
33 small -c core.compression=9 -c pack.compression=9
34 large -c pack.compression=0
35 small -c pack.compression=9
36 EOF
38 test_done