@@ -12,7 +12,7 @@ TEST_PASSES_SANITIZE_LEAK=true
12
12
. ./test-lib.sh
13
13
. " $TEST_DIRECTORY " /lib-terminal.sh
14
14
15
- # 120 character name
15
+ # 120- character name
16
16
name=aaaaaaaaaa
17
17
name=$name$name$name$name$name$name$name$name$name$name$name$name
18
18
test_expect_success ' preparation' '
@@ -58,15 +58,15 @@ while read verb expect cmd args
58
58
do
59
59
# No width limit applied when statNameWidth is ignored
60
60
case " $expect " in expect72|expect.6030)
61
- test_expect_success " $cmd $verb statNameWidth config with long name" '
61
+ test_expect_success " $cmd $verb diff. statNameWidth with long name" '
62
62
git -c diff.statNameWidth=30 $cmd $args >output &&
63
63
grep " | " output >actual &&
64
64
test_cmp $expect actual
65
65
' ;;
66
66
esac
67
67
# Maximum width limit still applied when statNameWidth is ignored
68
68
case " $expect " in expect.60|expect.6030)
69
- test_expect_success " $cmd --stat=width $verb statNameWidth config with long name" '
69
+ test_expect_success " $cmd --stat=width $verb diff. statNameWidth with long name" '
70
70
git -c diff.statNameWidth=30 $cmd $args --stat=60 >output &&
71
71
grep " | " output >actual &&
72
72
test_cmp $expect actual
111
111
test_cmp $expect.6030 actual
112
112
'
113
113
114
- test_expect_success " $cmd --stat-name-width with long name" '
114
+ test_expect_success " $cmd --stat-name-width=width with long name" '
115
115
git $cmd $args --stat-name-width=30 >output &&
116
116
grep " | " output >actual &&
117
117
test_cmp $expect.6030 actual
@@ -123,7 +123,7 @@ expect show --stat
123
123
expect log -1 --stat
124
124
EOF
125
125
126
- test_expect_success ' preparation for big change tests' '
126
+ test_expect_success ' preparation for big- change tests' '
127
127
>abcd &&
128
128
git add abcd &&
129
129
git commit -m message &&
@@ -139,7 +139,7 @@ cat >expect72 <<'EOF'
139
139
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
140
140
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
141
141
EOF
142
- test_expect_success " format-patch --cover-letter ignores COLUMNS ( big change) " '
142
+ test_expect_success " format-patch --cover-letter ignores COLUMNS with big change" '
143
143
COLUMNS=200 git format-patch -1 --stdout --cover-letter >output &&
144
144
grep " | " output >actual &&
145
145
test_cmp expect72 actual
@@ -159,15 +159,15 @@ cat >expect200-graph <<'EOF'
159
159
EOF
160
160
while read verb expect cmd args
161
161
do
162
- test_expect_success " $cmd $verb COLUMNS ( big change) " '
162
+ test_expect_success " $cmd $verb COLUMNS with big change" '
163
163
COLUMNS=200 git $cmd $args >output &&
164
164
grep " | " output >actual &&
165
165
test_cmp "$expect" actual
166
166
'
167
167
168
168
case " $cmd " in diff|show) continue ;; esac
169
169
170
- test_expect_success " $cmd --graph $verb COLUMNS ( big change) " '
170
+ test_expect_success " $cmd --graph $verb COLUMNS with big change" '
171
171
COLUMNS=200 git $cmd $args --graph >output &&
172
172
grep " | " output >actual &&
173
173
test_cmp "$expect-graph" actual
@@ -187,15 +187,15 @@ cat >expect40-graph <<'EOF'
187
187
EOF
188
188
while read verb expect cmd args
189
189
do
190
- test_expect_success " $cmd $verb not enough COLUMNS ( big change) " '
190
+ test_expect_success " $cmd $verb not enough COLUMNS with big change" '
191
191
COLUMNS=40 git $cmd $args >output &&
192
192
grep " | " output >actual &&
193
193
test_cmp "$expect" actual
194
194
'
195
195
196
196
case " $cmd " in diff|show) continue ;; esac
197
197
198
- test_expect_success " $cmd --graph $verb not enough COLUMNS ( big change) " '
198
+ test_expect_success " $cmd --graph $verb not enough COLUMNS with big change" '
199
199
COLUMNS=40 git $cmd $args --graph >output &&
200
200
grep " | " output >actual &&
201
201
test_cmp "$expect-graph" actual
@@ -215,15 +215,15 @@ cat >expect40-graph <<'EOF'
215
215
EOF
216
216
while read verb expect cmd args
217
217
do
218
- test_expect_success " $cmd $verb statGraphWidth config " '
218
+ test_expect_success " $cmd $verb diff. statGraphWidth" '
219
219
git -c diff.statGraphWidth=26 $cmd $args >output &&
220
220
grep " | " output >actual &&
221
221
test_cmp "$expect" actual
222
222
'
223
223
224
224
case " $cmd " in diff|show) continue ;; esac
225
225
226
- test_expect_success " $cmd --graph $verb statGraphWidth config " '
226
+ test_expect_success " $cmd --graph $verb diff. statGraphWidth" '
227
227
git -c diff.statGraphWidth=26 $cmd $args --graph >output &&
228
228
grep " | " output >actual &&
229
229
test_cmp "$expect-graph" actual
255
255
test_cmp expect actual
256
256
'
257
257
258
- test_expect_success " $cmd --stat-graph-width with big change" '
258
+ test_expect_success " $cmd --stat-graph-width=width with big change" '
259
259
git $cmd $args --stat-graph-width=26 >output &&
260
260
grep " | " output >actual &&
261
261
test_cmp expect actual
269
269
test_cmp expect-graph actual
270
270
'
271
271
272
- test_expect_success " $cmd --stat-graph-width --graph with big change" '
272
+ test_expect_success " $cmd --stat-graph-width=width --graph with big change" '
273
273
git $cmd $args --stat-graph-width=26 --graph >output &&
274
274
grep " | " output >actual &&
275
275
test_cmp expect-graph actual
@@ -281,7 +281,7 @@ show --stat
281
281
log -1 --stat
282
282
EOF
283
283
284
- test_expect_success ' preparation for long filename tests' '
284
+ test_expect_success ' preparation for long-name tests' '
285
285
cp abcd aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
286
286
git add aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
287
287
git commit -m message
@@ -329,15 +329,15 @@ cat >expect200-graph <<'EOF'
329
329
EOF
330
330
while read verb expect cmd args
331
331
do
332
- test_expect_success " $cmd $verb COLUMNS ( long filename) " '
332
+ test_expect_success " $cmd $verb COLUMNS with long name " '
333
333
COLUMNS=200 git $cmd $args >output &&
334
334
grep " | " output >actual &&
335
335
test_cmp "$expect" actual
336
336
'
337
337
338
338
case " $cmd " in diff|show) continue ;; esac
339
339
340
- test_expect_success " $cmd --graph $verb COLUMNS ( long filename) " '
340
+ test_expect_success " $cmd --graph $verb COLUMNS with long name " '
341
341
COLUMNS=200 git $cmd $args --graph >output &&
342
342
grep " | " output >actual &&
343
343
test_cmp "$expect-graph" actual
358
358
while read verb expect cmd args
359
359
do
360
360
test_expect_success COLUMNS_CAN_BE_1 \
361
- " $cmd $verb prefix greater than COLUMNS ( big change) " '
361
+ " $cmd $verb prefix greater than COLUMNS with big change" '
362
362
COLUMNS=1 git $cmd $args >output &&
363
363
grep " | " output >actual &&
364
364
test_cmp "$expect" actual
367
367
case " $cmd " in diff|show) continue ;; esac
368
368
369
369
test_expect_success COLUMNS_CAN_BE_1 \
370
- " $cmd --graph $verb prefix greater than COLUMNS ( big change) " '
370
+ " $cmd --graph $verb prefix greater than COLUMNS with big change" '
371
371
COLUMNS=1 git $cmd $args --graph >output &&
372
372
grep " | " output >actual &&
373
373
test_cmp "$expect-graph" actual
382
382
cat > expect << 'EOF '
383
383
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
384
384
EOF
385
- test_expect_success ' merge --stat respects COLUMNS (big change)' '
386
- git checkout -b branch HEAD^^ &&
385
+ test_expect_success ' merge --stat respects diff.statGraphWidth with big change' '
386
+ git checkout -b branch1 HEAD^^ &&
387
+ git -c diff.statGraphWidth=26 merge --stat --no-ff main^ >output &&
388
+ grep " | " output >actual &&
389
+ test_cmp expect40 actual
390
+ '
391
+ test_expect_success ' merge --stat respects COLUMNS with big change' '
392
+ git checkout -b branch2 HEAD^^ &&
387
393
COLUMNS=100 git merge --stat --no-ff main^ >output &&
388
394
grep " | " output >actual &&
389
395
test_cmp expect actual
@@ -392,7 +398,17 @@ test_expect_success 'merge --stat respects COLUMNS (big change)' '
392
398
cat > expect << 'EOF '
393
399
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++
394
400
EOF
395
- test_expect_success ' merge --stat respects COLUMNS (long filename)' '
401
+ cat > expect.30 << 'EOF '
402
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++++++++++++++++++++++
403
+ EOF
404
+ test_expect_success ' merge --stat respects diff.statNameWidth with long name' '
405
+ git switch branch1 &&
406
+ git -c diff.statNameWidth=30 merge --stat --no-ff main >output &&
407
+ grep " | " output >actual &&
408
+ test_cmp expect.30 actual
409
+ '
410
+ test_expect_success ' merge --stat respects COLUMNS with long name' '
411
+ git switch branch2 &&
396
412
COLUMNS=100 git merge --stat --no-ff main >output &&
397
413
grep " | " output >actual &&
398
414
test_cmp expect actual
0 commit comments