440
441
run_dir_diff_test 'difftool -d' '
442
git difftool -d $symlinks --extcmd ls branch >output &&
443
- grep sub output &&
444
- grep file output
443
+ grep "^sub$" output &&
444
+ grep "^file$" output
445
'
446
447
run_dir_diff_test 'difftool --dir-diff' '
448
git difftool --dir-diff $symlinks --extcmd ls branch >output &&
449
- grep sub output &&
450
- grep file output
449
+ grep "^sub$" output &&
450
+ grep "^file$" output
451
'
452
453
run_dir_diff_test 'difftool --dir-diff ignores --prompt' '
454
git difftool --dir-diff $symlinks --prompt --extcmd ls branch >output &&
455
- grep sub output &&
456
- grep file output
455
+ grep "^sub$" output &&
456
+ grep "^file$" output
457
'
458
459
run_dir_diff_test 'difftool --dir-diff branch from subdirectory' '
462
git difftool --dir-diff $symlinks --extcmd ls branch >output &&
463
# "sub" must only exist in "right"
464
# "file" and "file2" must be listed in both "left" and "right"
465
- grep sub output >sub-output &&
465
+ grep "^sub$" output >sub-output &&
466
test_line_count = 1 sub-output &&
467
- grep file"$" output >file-output &&
467
+ grep "^file$" output >file-output &&
468
test_line_count = 2 file-output &&
469
- grep file2 output >file2-output &&
469
+ grep "^file2$" output >file2-output &&
470
test_line_count = 2 file2-output
471
)
472
'
477
git difftool --dir-diff $symlinks --extcmd ls v1 >output &&
478
# "sub" and "file" exist in both v1 and HEAD.
479
# "file2" is unchanged.
480
- grep sub output >sub-output &&
480
+ grep "^sub$" output >sub-output &&
481
test_line_count = 2 sub-output &&
482
- grep file output >file-output &&
482
+ grep "^file$" output >file-output &&
483
test_line_count = 2 file-output &&
484
- ! grep file2 output
484
+ ! grep "^file2$" output
485
)
486
'
487
491
git difftool --dir-diff $symlinks --extcmd ls branch -- .>output &&
492
# "sub" only exists in "right"
493
# "file" and "file2" must not be listed
494
- grep sub output >sub-output &&
494
+ grep "^sub$" output >sub-output &&
495
test_line_count = 1 sub-output &&
496
- ! grep file output
496
+ ! grep "^file$" output
497
)
498
'
499
503
git difftool --dir-diff $symlinks --extcmd ls v1 -- .>output &&
504
# "sub" exists in v1 and HEAD
505
# "file" is filtered out by the pathspec
506
- grep sub output >sub-output &&
506
+ grep "^sub$" output >sub-output &&
507
test_line_count = 2 sub-output &&
508
- ! grep file output
508
+ ! grep "^file$" output
509
)
510
'
511
518
cd sub &&
519
git difftool --dir-diff $symlinks --extcmd ls \
520
branch -- sub >output &&
521
- grep sub output &&
522
- ! grep file output
521
+ grep "^sub$" output &&
522
+ ! grep "^file$" output
523
)
524
'
525
527
test_when_finished git reset --hard &&
528
rm file2 &&
529
git difftool --dir-diff $symlinks --extcmd ls branch master >output &&
530
- grep file2 output
530
+ grep "^file2$" output
531
'
532
533
run_dir_diff_test 'difftool --dir-diff with unmerged files' '