49
EOF
50
51
cat >expect.60 <<-'EOF'
52
- ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
52
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
53
EOF
54
cat >expect.6030 <<-'EOF'
55
...aaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
56
EOF
57
-cat >expect2.60 <<-'EOF'
57
+while read verb expect cmd args
58
+do
59
+ # No width limit applied when statNameWidth is ignored
60
+ case "$expect" in expect72|expect.6030)
61
+ test_expect_success "$cmd $verb statNameWidth config with long name" '
62
+ git -c diff.statNameWidth=30 $cmd $args >output &&
63
+ grep " | " output >actual &&
64
+ test_cmp $expect actual
65
+ ';;
66
+ esac
67
+ # Maximum width limit still applied when statNameWidth is ignored
68
+ case "$expect" in expect.60|expect.6030)
69
+ test_expect_success "$cmd --stat=width $verb statNameWidth config with long name" '
70
+ git -c diff.statNameWidth=30 $cmd $args --stat=60 >output &&
71
+ grep " | " output >actual &&
72
+ test_cmp $expect actual
73
+ ';;
74
+ esac
75
+done <<\EOF
76
+ignores expect72 format-patch -1 --stdout
77
+ignores expect.60 format-patch -1 --stdout
78
+respects expect.6030 diff HEAD^ HEAD --stat
79
+respects expect.6030 show --stat
80
+respects expect.6030 log -1 --stat
81
+EOF
82
+
83
+cat >expect.40 <<-'EOF'
84
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
85
+EOF
86
+cat >expect2.40 <<-'EOF'
87
...aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
88
...aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
89
EOF
96
test_expect_success "$cmd --stat=width: a long name is given more room when the bar is short" '
97
git $cmd $args --stat=40 >output &&
98
grep " | " output >actual &&
70
- test_cmp $expect.60 actual
99
+ test_cmp $expect.40 actual
100
'
101
102
test_expect_success "$cmd --stat-width=width with long name" '
103
git $cmd $args --stat-width=40 >output &&
104
grep " | " output >actual &&
76
- test_cmp $expect.60 actual
105
+ test_cmp $expect.40 actual
106
'
107
79
- test_expect_success "$cmd --stat=...,name-width with long name" '
108
+ test_expect_success "$cmd --stat=width,name-width with long name" '
109
git $cmd $args --stat=60,30 >output &&
110
grep " | " output >actual &&
111
test_cmp $expect.6030 actual
123
expect log -1 --stat
124
EOF
125
97
-
126
test_expect_success 'preparation for big change tests' '
127
>abcd &&
128
git add abcd &&
235
respects expect40 log -1 --stat
236
EOF
237
210
-
238
cat >expect <<'EOF'
239
abcd | 1000 ++++++++++++++++++++++++++
240
EOF