@@ -19,7 +19,7 @@ test_expect_success 'setup' '
19
19
test_expect_success TTY ' some commands use a pager' '
20
20
rm -f paginated.out &&
21
21
test_terminal git log &&
22
- test -e paginated.out
22
+ test_path_is_file paginated.out
23
23
'
24
24
25
25
test_expect_failure TTY ' pager runs from subdir' '
@@ -65,49 +65,49 @@ test_expect_success !MINGW,TTY 'LESS and LV envvars set by git-sh-setup' '
65
65
test_expect_success TTY ' some commands do not use a pager' '
66
66
rm -f paginated.out &&
67
67
test_terminal git rev-list HEAD &&
68
- ! test -e paginated.out
68
+ test_path_is_missing paginated.out
69
69
'
70
70
71
71
test_expect_success ' no pager when stdout is a pipe' '
72
72
rm -f paginated.out &&
73
73
git log | cat &&
74
- ! test -e paginated.out
74
+ test_path_is_missing paginated.out
75
75
'
76
76
77
77
test_expect_success ' no pager when stdout is a regular file' '
78
78
rm -f paginated.out &&
79
79
git log >file &&
80
- ! test -e paginated.out
80
+ test_path_is_missing paginated.out
81
81
'
82
82
83
83
test_expect_success TTY ' git --paginate rev-list uses a pager' '
84
84
rm -f paginated.out &&
85
85
test_terminal git --paginate rev-list HEAD &&
86
- test -e paginated.out
86
+ test_path_is_file paginated.out
87
87
'
88
88
89
89
test_expect_success ' no pager even with --paginate when stdout is a pipe' '
90
90
rm -f file paginated.out &&
91
91
git --paginate log | cat &&
92
- ! test -e paginated.out
92
+ test_path_is_missing paginated.out
93
93
'
94
94
95
95
test_expect_success TTY ' no pager with --no-pager' '
96
96
rm -f paginated.out &&
97
97
test_terminal git --no-pager log &&
98
- ! test -e paginated.out
98
+ test_path_is_missing paginated.out
99
99
'
100
100
101
101
test_expect_success TTY ' configuration can disable pager' '
102
102
rm -f paginated.out &&
103
103
test_unconfig pager.grep &&
104
104
test_terminal git grep initial &&
105
- test -e paginated.out &&
105
+ test_path_is_file paginated.out &&
106
106
107
107
rm -f paginated.out &&
108
108
test_config pager.grep false &&
109
109
test_terminal git grep initial &&
110
- ! test -e paginated.out
110
+ test_path_is_missing paginated.out
111
111
'
112
112
113
113
test_expect_success TTY ' configuration can enable pager (from subdir)' '
@@ -122,107 +122,107 @@ test_expect_success TTY 'configuration can enable pager (from subdir)' '
122
122
test_terminal git bundle unbundle ../test.bundle
123
123
) &&
124
124
{
125
- test -e paginated.out ||
126
- test -e subdir/paginated.out
125
+ test_path_is_file paginated.out ||
126
+ test_path_is_file subdir/paginated.out
127
127
}
128
128
'
129
129
130
130
test_expect_success TTY ' git tag -l defaults to paging' '
131
131
rm -f paginated.out &&
132
132
test_terminal git tag -l &&
133
- test -e paginated.out
133
+ test_path_is_file paginated.out
134
134
'
135
135
136
136
test_expect_success TTY ' git tag -l respects pager.tag' '
137
137
rm -f paginated.out &&
138
138
test_terminal git -c pager.tag=false tag -l &&
139
- ! test -e paginated.out
139
+ test_path_is_missing paginated.out
140
140
'
141
141
142
142
test_expect_success TTY ' git tag -l respects --no-pager' '
143
143
rm -f paginated.out &&
144
144
test_terminal git -c pager.tag --no-pager tag -l &&
145
- ! test -e paginated.out
145
+ test_path_is_missing paginated.out
146
146
'
147
147
148
148
test_expect_success TTY ' git tag with no args defaults to paging' '
149
149
# no args implies -l so this should page like -l
150
150
rm -f paginated.out &&
151
151
test_terminal git tag &&
152
- test -e paginated.out
152
+ test_path_is_file paginated.out
153
153
'
154
154
155
155
test_expect_success TTY ' git tag with no args respects pager.tag' '
156
156
# no args implies -l so this should page like -l
157
157
rm -f paginated.out &&
158
158
test_terminal git -c pager.tag=false tag &&
159
- ! test -e paginated.out
159
+ test_path_is_missing paginated.out
160
160
'
161
161
162
162
test_expect_success TTY ' git tag --contains defaults to paging' '
163
163
# --contains implies -l so this should page like -l
164
164
rm -f paginated.out &&
165
165
test_terminal git tag --contains &&
166
- test -e paginated.out
166
+ test_path_is_file paginated.out
167
167
'
168
168
169
169
test_expect_success TTY ' git tag --contains respects pager.tag' '
170
170
# --contains implies -l so this should page like -l
171
171
rm -f paginated.out &&
172
172
test_terminal git -c pager.tag=false tag --contains &&
173
- ! test -e paginated.out
173
+ test_path_is_missing paginated.out
174
174
'
175
175
176
176
test_expect_success TTY ' git tag -a defaults to not paging' '
177
177
test_when_finished "git tag -d newtag" &&
178
178
rm -f paginated.out &&
179
179
test_terminal git tag -am message newtag &&
180
- ! test -e paginated.out
180
+ test_path_is_missing paginated.out
181
181
'
182
182
183
183
test_expect_success TTY ' git tag -a ignores pager.tag' '
184
184
test_when_finished "git tag -d newtag" &&
185
185
rm -f paginated.out &&
186
186
test_terminal git -c pager.tag tag -am message newtag &&
187
- ! test -e paginated.out
187
+ test_path_is_missing paginated.out
188
188
'
189
189
190
190
test_expect_success TTY ' git tag -a respects --paginate' '
191
191
test_when_finished "git tag -d newtag" &&
192
192
rm -f paginated.out &&
193
193
test_terminal git --paginate tag -am message newtag &&
194
- test -e paginated.out
194
+ test_path_is_file paginated.out
195
195
'
196
196
197
197
test_expect_success TTY ' git tag as alias ignores pager.tag with -a' '
198
198
test_when_finished "git tag -d newtag" &&
199
199
rm -f paginated.out &&
200
200
test_terminal git -c pager.tag -c alias.t=tag t -am message newtag &&
201
- ! test -e paginated.out
201
+ test_path_is_missing paginated.out
202
202
'
203
203
204
204
test_expect_success TTY ' git tag as alias respects pager.tag with -l' '
205
205
rm -f paginated.out &&
206
206
test_terminal git -c pager.tag=false -c alias.t=tag t -l &&
207
- ! test -e paginated.out
207
+ test_path_is_missing paginated.out
208
208
'
209
209
210
210
test_expect_success TTY ' git branch defaults to paging' '
211
211
rm -f paginated.out &&
212
212
test_terminal git branch &&
213
- test -e paginated.out
213
+ test_path_is_file paginated.out
214
214
'
215
215
216
216
test_expect_success TTY ' git branch respects pager.branch' '
217
217
rm -f paginated.out &&
218
218
test_terminal git -c pager.branch=false branch &&
219
- ! test -e paginated.out
219
+ test_path_is_missing paginated.out
220
220
'
221
221
222
222
test_expect_success TTY ' git branch respects --no-pager' '
223
223
rm -f paginated.out &&
224
224
test_terminal git --no-pager branch &&
225
- ! test -e paginated.out
225
+ test_path_is_missing paginated.out
226
226
'
227
227
228
228
test_expect_success TTY ' git branch --edit-description ignores pager.branch' '
@@ -232,8 +232,8 @@ test_expect_success TTY 'git branch --edit-description ignores pager.branch' '
232
232
touch editor.used
233
233
EOF
234
234
EDITOR=./editor test_terminal git -c pager.branch branch --edit-description &&
235
- ! test -e paginated.out &&
236
- test -e editor.used
235
+ test_path_is_missing paginated.out &&
236
+ test_path_is_file editor.used
237
237
'
238
238
239
239
test_expect_success TTY ' git branch --set-upstream-to ignores pager.branch' '
@@ -242,13 +242,13 @@ test_expect_success TTY 'git branch --set-upstream-to ignores pager.branch' '
242
242
test_when_finished "git branch -D other" &&
243
243
test_terminal git -c pager.branch branch --set-upstream-to=other &&
244
244
test_when_finished "git branch --unset-upstream" &&
245
- ! test -e paginated.out
245
+ test_path_is_missing paginated.out
246
246
'
247
247
248
248
test_expect_success TTY ' git config ignores pager.config when setting' '
249
249
rm -f paginated.out &&
250
250
test_terminal git -c pager.config config foo.bar bar &&
251
- ! test -e paginated.out
251
+ test_path_is_missing paginated.out
252
252
'
253
253
254
254
test_expect_success TTY ' git config --edit ignores pager.config' '
@@ -257,33 +257,33 @@ test_expect_success TTY 'git config --edit ignores pager.config' '
257
257
touch editor.used
258
258
EOF
259
259
EDITOR=./editor test_terminal git -c pager.config config --edit &&
260
- ! test -e paginated.out &&
261
- test -e editor.used
260
+ test_path_is_missing paginated.out &&
261
+ test_path_is_file editor.used
262
262
'
263
263
264
264
test_expect_success TTY ' git config --get ignores pager.config' '
265
265
rm -f paginated.out &&
266
266
test_terminal git -c pager.config config --get foo.bar &&
267
- ! test -e paginated.out
267
+ test_path_is_missing paginated.out
268
268
'
269
269
270
270
test_expect_success TTY ' git config --get-urlmatch defaults to paging' '
271
271
rm -f paginated.out &&
272
272
test_terminal git -c http."https://foo.com/".bar=foo \
273
273
config --get-urlmatch http https://foo.com &&
274
- test -e paginated.out
274
+ test_path_is_file paginated.out
275
275
'
276
276
277
277
test_expect_success TTY ' git config --get-all respects pager.config' '
278
278
rm -f paginated.out &&
279
279
test_terminal git -c pager.config=false config --get-all foo.bar &&
280
- ! test -e paginated.out
280
+ test_path_is_missing paginated.out
281
281
'
282
282
283
283
test_expect_success TTY ' git config --list defaults to paging' '
284
284
rm -f paginated.out &&
285
285
test_terminal git config --list &&
286
- test -e paginated.out
286
+ test_path_is_file paginated.out
287
287
'
288
288
289
289
@@ -392,7 +392,7 @@ test_default_pager() {
392
392
export PATH &&
393
393
$full_command
394
394
) &&
395
- test -e default_pager_used
395
+ test_path_is_file default_pager_used
396
396
"
397
397
}
398
398
@@ -406,7 +406,7 @@ test_PAGER_overrides() {
406
406
PAGER='wc >PAGER_used' &&
407
407
export PAGER &&
408
408
$full_command &&
409
- test -e PAGER_used
409
+ test_path_is_file PAGER_used
410
410
"
411
411
}
412
412
@@ -432,7 +432,7 @@ test_core_pager() {
432
432
export PAGER &&
433
433
test_config core.pager 'wc >core.pager_used' &&
434
434
$full_command &&
435
- ${if_local_config} test -e core.pager_used
435
+ ${if_local_config} test_path_is_file core.pager_used
436
436
"
437
437
}
438
438
@@ -464,7 +464,7 @@ test_pager_subdir_helper() {
464
464
cd sub &&
465
465
$full_command
466
466
) &&
467
- ${if_local_config} test -e core.pager_used
467
+ ${if_local_config} test_path_is_file core.pager_used
468
468
"
469
469
}
470
470
@@ -477,7 +477,7 @@ test_GIT_PAGER_overrides() {
477
477
GIT_PAGER='wc >GIT_PAGER_used' &&
478
478
export GIT_PAGER &&
479
479
$full_command &&
480
- test -e GIT_PAGER_used
480
+ test_path_is_file GIT_PAGER_used
481
481
"
482
482
}
483
483
@@ -489,7 +489,7 @@ test_doesnt_paginate() {
489
489
GIT_PAGER='wc >GIT_PAGER_used' &&
490
490
export GIT_PAGER &&
491
491
$full_command &&
492
- ! test -e GIT_PAGER_used
492
+ test_path_is_missing GIT_PAGER_used
493
493
"
494
494
}
495
495
0 commit comments