blob: 57d916524ecd4125717f8b70b310e965b765571e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/bin/sh
test_description='compression setting of fast-import utility'
. ./test-lib.sh
import_large () {
(
echo blob
echo "data <<EOD"
printf "%2000000s\n" "$*"
echo EOD
) | git "$@" fast-import
}
while read expect config
do
test_expect_success "fast-import (packed) with $config" '
test_when_finished "rm -f .git/objects/pack/pack-*.*" &&
test_when_finished "rm -rf .git/objects/??" &&
import_large -c fastimport.unpacklimit=0 $config &&
sz=$(test_file_size .git/objects/pack/pack-*.pack) &&
case "$expect" in
small) test "$sz" -le 100000 ;;
large) test "$sz" -ge 100000 ;;
esac
'
done <<\EOF
large -c core.compression=0
small -c core.compression=9
large -c core.compression=0 -c pack.compression=0
large -c core.compression=9 -c pack.compression=0
small -c core.compression=0 -c pack.compression=9
small -c core.compression=9 -c pack.compression=9
large -c pack.compression=0
small -c pack.compression=9
EOF
while read expect config
do
test_expect_success "fast-import (loose) with $config" '
test_when_finished "rm -f .git/objects/pack/pack-*.*" &&
test_when_finished "rm -rf .git/objects/??" &&
import_large -c fastimport.unpacklimit=9 $config &&
sz=$(test_file_size .git/objects/??/????*) &&
case "$expect" in
small) test "$sz" -le 100000 ;;
large) test "$sz" -ge 100000 ;;
esac
'
done <<\EOF
large -c core.compression=0
small -c core.compression=9
large -c core.compression=0 -c core.loosecompression=0
large -c core.compression=9 -c core.loosecompression=0
small -c core.compression=0 -c core.loosecompression=9
small -c core.compression=9 -c core.loosecompression=9
large -c core.loosecompression=0
small -c core.loosecompression=9
EOF
test_done
|