]> git.ipfire.org Git - thirdparty/git.git/blame - t/t5315-pack-objects-compression.sh
The third batch
[thirdparty/git.git] / t / t5315-pack-objects-compression.sh
CommitLineData
8de7eeb5
JH
1#!/bin/sh
2
3test_description='pack-object compression configuration'
4
3e3b9321 5TEST_PASSES_SANITIZE_LEAK=true
8de7eeb5
JH
6. ./test-lib.sh
7
8de7eeb5
JH
8test_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
17while read expect config
18do
19 test_expect_success "pack-objects with $config" '
20 test_when_finished "rm -f pack-*.*" &&
21 git $config pack-objects pack <object-name &&
53b67a80 22 sz=$(test_file_size pack-*.pack) &&
8de7eeb5
JH
23 case "$expect" in
24 small) test "$sz" -le 100000 ;;
25 large) test "$sz" -ge 100000 ;;
26 esac
27 '
28done <<\EOF
29large -c core.compression=0
30small -c core.compression=9
31large -c core.compression=0 -c pack.compression=0
32large -c core.compression=9 -c pack.compression=0
33small -c core.compression=0 -c pack.compression=9
34small -c core.compression=9 -c pack.compression=9
35large -c pack.compression=0
36small -c pack.compression=9
37EOF
38
39test_done