|
105 | 105 |
|
106 | 106 | test_expect_success "grep -w $L (w)" '
|
107 | 107 | : >expected &&
|
108 |
| - test_must_fail git grep -n -w -e "^w" >actual && |
| 108 | + test_must_fail git grep -n -w -e "^w" $H >actual && |
109 | 109 | test_cmp expected actual
|
110 | 110 | '
|
111 | 111 |
|
@@ -240,92 +240,104 @@ do
|
240 | 240 | test_cmp expected actual
|
241 | 241 | '
|
242 | 242 | test_expect_success "grep $L with grep.extendedRegexp=false" '
|
243 |
| - echo "ab:a+bc" >expected && |
244 |
| - git -c grep.extendedRegexp=false grep "a+b*c" ab >actual && |
| 243 | + echo "${HC}ab:a+bc" >expected && |
| 244 | + git -c grep.extendedRegexp=false grep "a+b*c" $H ab >actual && |
245 | 245 | test_cmp expected actual
|
246 | 246 | '
|
247 | 247 |
|
248 | 248 | test_expect_success "grep $L with grep.extendedRegexp=true" '
|
249 |
| - echo "ab:abc" >expected && |
250 |
| - git -c grep.extendedRegexp=true grep "a+b*c" ab >actual && |
| 249 | + echo "${HC}ab:abc" >expected && |
| 250 | + git -c grep.extendedRegexp=true grep "a+b*c" $H ab >actual && |
251 | 251 | test_cmp expected actual
|
252 | 252 | '
|
253 | 253 |
|
254 | 254 | test_expect_success "grep $L with grep.patterntype=basic" '
|
255 |
| - echo "ab:a+bc" >expected && |
256 |
| - git -c grep.patterntype=basic grep "a+b*c" ab >actual && |
| 255 | + echo "${HC}ab:a+bc" >expected && |
| 256 | + git -c grep.patterntype=basic grep "a+b*c" $H ab >actual && |
257 | 257 | test_cmp expected actual
|
258 | 258 | '
|
259 | 259 |
|
260 | 260 | test_expect_success "grep $L with grep.patterntype=extended" '
|
261 |
| - echo "ab:abc" >expected && |
262 |
| - git -c grep.patterntype=extended grep "a+b*c" ab >actual && |
| 261 | + echo "${HC}ab:abc" >expected && |
| 262 | + git -c grep.patterntype=extended grep "a+b*c" $H ab >actual && |
263 | 263 | test_cmp expected actual
|
264 | 264 | '
|
265 | 265 |
|
266 | 266 | test_expect_success "grep $L with grep.patterntype=fixed" '
|
267 |
| - echo "ab:a+b*c" >expected && |
268 |
| - git -c grep.patterntype=fixed grep "a+b*c" ab >actual && |
| 267 | + echo "${HC}ab:a+b*c" >expected && |
| 268 | + git -c grep.patterntype=fixed grep "a+b*c" $H ab >actual && |
269 | 269 | test_cmp expected actual
|
270 | 270 | '
|
271 | 271 |
|
272 | 272 | test_expect_success LIBPCRE "grep $L with grep.patterntype=perl" '
|
273 |
| - echo "ab:a+b*c" >expected && |
274 |
| - git -c grep.patterntype=perl grep "a\x{2b}b\x{2a}c" ab >actual && |
| 273 | + echo "${HC}ab:a+b*c" >expected && |
| 274 | + git -c grep.patterntype=perl grep "a\x{2b}b\x{2a}c" $H ab >actual && |
275 | 275 | test_cmp expected actual
|
276 | 276 | '
|
277 | 277 |
|
278 | 278 | test_expect_success "grep $L with grep.patternType=default and grep.extendedRegexp=true" '
|
279 |
| - echo "ab:abc" >expected && |
| 279 | + echo "${HC}ab:abc" >expected && |
280 | 280 | git \
|
281 | 281 | -c grep.patternType=default \
|
282 | 282 | -c grep.extendedRegexp=true \
|
283 |
| - grep "a+b*c" ab >actual && |
| 283 | + grep "a+b*c" $H ab >actual && |
284 | 284 | test_cmp expected actual
|
285 | 285 | '
|
286 | 286 |
|
287 | 287 | test_expect_success "grep $L with grep.extendedRegexp=true and grep.patternType=default" '
|
288 |
| - echo "ab:abc" >expected && |
| 288 | + echo "${HC}ab:abc" >expected && |
289 | 289 | git \
|
290 | 290 | -c grep.extendedRegexp=true \
|
291 | 291 | -c grep.patternType=default \
|
292 |
| - grep "a+b*c" ab >actual && |
| 292 | + grep "a+b*c" $H ab >actual && |
293 | 293 | test_cmp expected actual
|
294 | 294 | '
|
295 | 295 |
|
296 |
| - test_expect_success 'grep $L with grep.patternType=extended and grep.extendedRegexp=false' ' |
297 |
| - echo "ab:abc" >expected && |
| 296 | + test_expect_success "grep $L with grep.patternType=extended and grep.extendedRegexp=false" ' |
| 297 | + echo "${HC}ab:abc" >expected && |
298 | 298 | git \
|
299 | 299 | -c grep.patternType=extended \
|
300 | 300 | -c grep.extendedRegexp=false \
|
301 |
| - grep "a+b*c" ab >actual && |
| 301 | + grep "a+b*c" $H ab >actual && |
302 | 302 | test_cmp expected actual
|
303 | 303 | '
|
304 | 304 |
|
305 |
| - test_expect_success 'grep $L with grep.patternType=basic and grep.extendedRegexp=true' ' |
306 |
| - echo "ab:a+bc" >expected && |
| 305 | + test_expect_success "grep $L with grep.patternType=basic and grep.extendedRegexp=true" ' |
| 306 | + echo "${HC}ab:a+bc" >expected && |
307 | 307 | git \
|
308 | 308 | -c grep.patternType=basic \
|
309 | 309 | -c grep.extendedRegexp=true \
|
310 |
| - grep "a+b*c" ab >actual && |
| 310 | + grep "a+b*c" $H ab >actual && |
311 | 311 | test_cmp expected actual
|
312 | 312 | '
|
313 | 313 |
|
314 |
| - test_expect_success 'grep $L with grep.extendedRegexp=false and grep.patternType=extended' ' |
315 |
| - echo "ab:abc" >expected && |
| 314 | + test_expect_success "grep $L with grep.extendedRegexp=false and grep.patternType=extended" ' |
| 315 | + echo "${HC}ab:abc" >expected && |
316 | 316 | git \
|
317 | 317 | -c grep.extendedRegexp=false \
|
318 | 318 | -c grep.patternType=extended \
|
319 |
| - grep "a+b*c" ab >actual && |
| 319 | + grep "a+b*c" $H ab >actual && |
320 | 320 | test_cmp expected actual
|
321 | 321 | '
|
322 | 322 |
|
323 |
| - test_expect_success 'grep $L with grep.extendedRegexp=true and grep.patternType=basic' ' |
324 |
| - echo "ab:a+bc" >expected && |
| 323 | + test_expect_success "grep $L with grep.extendedRegexp=true and grep.patternType=basic" ' |
| 324 | + echo "${HC}ab:a+bc" >expected && |
325 | 325 | git \
|
326 | 326 | -c grep.extendedRegexp=true \
|
327 | 327 | -c grep.patternType=basic \
|
328 |
| - grep "a+b*c" ab >actual && |
| 328 | + grep "a+b*c" $H ab >actual && |
| 329 | + test_cmp expected actual |
| 330 | + ' |
| 331 | + |
| 332 | + test_expect_success "grep --count $L" ' |
| 333 | + echo ${HC}ab:3 >expected && |
| 334 | + git grep --count -e b $H -- ab >actual && |
| 335 | + test_cmp expected actual |
| 336 | + ' |
| 337 | + |
| 338 | + test_expect_success "grep --count -h $L" ' |
| 339 | + echo 3 >expected && |
| 340 | + git grep --count -h -e b $H -- ab >actual && |
329 | 341 | test_cmp expected actual
|
330 | 342 | '
|
331 | 343 | done
|
|
0 commit comments