Skip to content

Commit 36dcc02

Browse files
lucianpostongitster
authored andcommitted
t4052: Adjust --graph --stat output for prefixes
Adjust tests to verify that the commit history graph tree is taken into consideration when the diff stat output width is calculated. Signed-off-by: Lucian Poston <lucian.poston@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3f14513 commit 36dcc02

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

t/t4052-stat-output.sh

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ cat >expect200 <<'EOF'
8989
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9090
EOF
9191
cat >expect200-graph <<'EOF'
92-
| abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
92+
| abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9393
EOF
9494
while read verb expect cmd args
9595
do
@@ -117,7 +117,7 @@ cat >expect40 <<'EOF'
117117
abcd | 1000 ++++++++++++++++++++++++++
118118
EOF
119119
cat >expect40-graph <<'EOF'
120-
| abcd | 1000 ++++++++++++++++++++++++++
120+
| abcd | 1000 ++++++++++++++++++++++++
121121
EOF
122122
while read verb expect cmd args
123123
do
@@ -127,19 +127,35 @@ do
127127
test_cmp "$expect" actual
128128
'
129129

130-
test_expect_success "$cmd $verb statGraphWidth config" '
131-
git -c diff.statGraphWidth=26 $cmd $args >output
132-
grep " | " output >actual &&
133-
test_cmp "$expect" actual
134-
'
135-
136130
test "$cmd" != diff || continue
137131

138132
test_expect_success "$cmd --graph $verb not enough COLUMNS (big change)" '
139133
COLUMNS=40 git $cmd $args --graph >output
140134
grep " | " output >actual &&
141135
test_cmp "$expect-graph" actual
142136
'
137+
done <<\EOF
138+
ignores expect80 format-patch -1 --stdout
139+
respects expect40 diff HEAD^ HEAD --stat
140+
respects expect40 show --stat
141+
respects expect40 log -1 --stat
142+
EOF
143+
144+
cat >expect40 <<'EOF'
145+
abcd | 1000 ++++++++++++++++++++++++++
146+
EOF
147+
cat >expect40-graph <<'EOF'
148+
| abcd | 1000 ++++++++++++++++++++++++++
149+
EOF
150+
while read verb expect cmd args
151+
do
152+
test_expect_success "$cmd $verb statGraphWidth config" '
153+
git -c diff.statGraphWidth=26 $cmd $args >output
154+
grep " | " output >actual &&
155+
test_cmp "$expect" actual
156+
'
157+
158+
test "$cmd" != diff || continue
143159

144160
test_expect_success "$cmd --graph $verb statGraphWidth config" '
145161
git -c diff.statGraphWidth=26 $cmd $args --graph >output
@@ -244,7 +260,7 @@ cat >expect200 <<'EOF'
244260
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
245261
EOF
246262
cat >expect200-graph <<'EOF'
247-
| aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
263+
| aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
248264
EOF
249265
while read verb expect cmd args
250266
do

0 commit comments

Comments
 (0)