@@ -290,8 +290,8 @@ test_expect_success 'difftool + mergetool config variables' '
290
290
test_expect_success ' difftool.<tool>.path' '
291
291
test_config difftool.tkdiff.path echo &&
292
292
git difftool --tool=tkdiff --no-prompt branch >output &&
293
- lines=$( grep file output | wc -l) &&
294
- test "$lines" -eq 1
293
+ grep file output >grep-output &&
294
+ test_line_count = 1 grep-output
295
295
'
296
296
297
297
test_expect_success ' difftool --extcmd=cat' '
@@ -428,9 +428,12 @@ run_dir_diff_test 'difftool --dir-diff branch from subdirectory' '
428
428
git difftool --dir-diff $symlinks --extcmd ls branch >output &&
429
429
# "sub" must only exist in "right"
430
430
# "file" and "file2" must be listed in both "left" and "right"
431
- test "1" = $(grep sub output | wc -l) &&
432
- test "2" = $(grep file"$" output | wc -l) &&
433
- test "2" = $(grep file2 output | wc -l)
431
+ grep sub output > sub-output &&
432
+ test_line_count = 1 sub-output &&
433
+ grep file"$" output >file-output &&
434
+ test_line_count = 2 file-output &&
435
+ grep file2 output >file2-output &&
436
+ test_line_count = 2 file2-output
434
437
)
435
438
'
436
439
@@ -440,9 +443,11 @@ run_dir_diff_test 'difftool --dir-diff v1 from subdirectory' '
440
443
git difftool --dir-diff $symlinks --extcmd ls v1 >output &&
441
444
# "sub" and "file" exist in both v1 and HEAD.
442
445
# "file2" is unchanged.
443
- test "2" = $(grep sub output | wc -l) &&
444
- test "2" = $(grep file output | wc -l) &&
445
- test "0" = $(grep file2 output | wc -l)
446
+ grep sub output >sub-output &&
447
+ test_line_count = 2 sub-output &&
448
+ grep file output >file-output &&
449
+ test_line_count = 2 file-output &&
450
+ ! grep file2 output
446
451
)
447
452
'
448
453
@@ -452,8 +457,9 @@ run_dir_diff_test 'difftool --dir-diff branch from subdirectory w/ pathspec' '
452
457
git difftool --dir-diff $symlinks --extcmd ls branch -- .>output &&
453
458
# "sub" only exists in "right"
454
459
# "file" and "file2" must not be listed
455
- test "1" = $(grep sub output | wc -l) &&
456
- test "0" = $(grep file output | wc -l)
460
+ grep sub output >sub-output &&
461
+ test_line_count = 1 sub-output &&
462
+ ! grep file output
457
463
)
458
464
'
459
465
@@ -463,8 +469,9 @@ run_dir_diff_test 'difftool --dir-diff v1 from subdirectory w/ pathspec' '
463
469
git difftool --dir-diff $symlinks --extcmd ls v1 -- .>output &&
464
470
# "sub" exists in v1 and HEAD
465
471
# "file" is filtered out by the pathspec
466
- test "2" = $(grep sub output | wc -l) &&
467
- test "0" = $(grep file output | wc -l)
472
+ grep sub output >sub-output &&
473
+ test_line_count = 2 sub-output &&
474
+ ! grep file output
468
475
)
469
476
'
470
477
0 commit comments