summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-02-10 22:48:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-10 22:48:32 (GMT)
commit04703f64bee1b126b99d5eded0c7b954aa5abfbe (patch)
tree91c89e0d0adc713d8af4b768a872a1ec94e156d7 /t/t7800-difftool.sh
parentc9f94ab4fa42c3fce6c8fa04bb850f73e7f1cd54 (diff)
parente3f5da7e60060bacd2910b022e30449213e2370b (diff)
downloadgit-04703f64bee1b126b99d5eded0c7b954aa5abfbe.zip
git-04703f64bee1b126b99d5eded0c7b954aa5abfbe.tar.gz
git-04703f64bee1b126b99d5eded0c7b954aa5abfbe.tar.bz2
Merge branch 'sg/t7800-difftool-robustify'
Test fix. * sg/t7800-difftool-robustify: t7800-difftool: don't accidentally match tmp dirs
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh38
1 files changed, 19 insertions, 19 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 9662abc..9192c14 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -443,20 +443,20 @@ run_dir_diff_test () {
run_dir_diff_test 'difftool -d' '
git difftool -d $symlinks --extcmd ls branch >output &&
- grep sub output &&
- grep file output
+ grep "^sub$" output &&
+ grep "^file$" output
'
run_dir_diff_test 'difftool --dir-diff' '
git difftool --dir-diff $symlinks --extcmd ls branch >output &&
- grep sub output &&
- grep file output
+ grep "^sub$" output &&
+ grep "^file$" output
'
run_dir_diff_test 'difftool --dir-diff ignores --prompt' '
git difftool --dir-diff $symlinks --prompt --extcmd ls branch >output &&
- grep sub output &&
- grep file output
+ grep "^sub$" output &&
+ grep "^file$" output
'
run_dir_diff_test 'difftool --dir-diff branch from subdirectory' '
@@ -465,11 +465,11 @@ run_dir_diff_test 'difftool --dir-diff branch from subdirectory' '
git difftool --dir-diff $symlinks --extcmd ls branch >output &&
# "sub" must only exist in "right"
# "file" and "file2" must be listed in both "left" and "right"
- grep sub output >sub-output &&
+ grep "^sub$" output >sub-output &&
test_line_count = 1 sub-output &&
- grep file"$" output >file-output &&
+ grep "^file$" output >file-output &&
test_line_count = 2 file-output &&
- grep file2 output >file2-output &&
+ grep "^file2$" output >file2-output &&
test_line_count = 2 file2-output
)
'
@@ -480,11 +480,11 @@ run_dir_diff_test 'difftool --dir-diff v1 from subdirectory' '
git difftool --dir-diff $symlinks --extcmd ls v1 >output &&
# "sub" and "file" exist in both v1 and HEAD.
# "file2" is unchanged.
- grep sub output >sub-output &&
+ grep "^sub$" output >sub-output &&
test_line_count = 2 sub-output &&
- grep file output >file-output &&
+ grep "^file$" output >file-output &&
test_line_count = 2 file-output &&
- ! grep file2 output
+ ! grep "^file2$" output
)
'
@@ -494,9 +494,9 @@ run_dir_diff_test 'difftool --dir-diff branch from subdirectory w/ pathspec' '
git difftool --dir-diff $symlinks --extcmd ls branch -- .>output &&
# "sub" only exists in "right"
# "file" and "file2" must not be listed
- grep sub output >sub-output &&
+ grep "^sub$" output >sub-output &&
test_line_count = 1 sub-output &&
- ! grep file output
+ ! grep "^file$" output
)
'
@@ -506,9 +506,9 @@ run_dir_diff_test 'difftool --dir-diff v1 from subdirectory w/ pathspec' '
git difftool --dir-diff $symlinks --extcmd ls v1 -- .>output &&
# "sub" exists in v1 and HEAD
# "file" is filtered out by the pathspec
- grep sub output >sub-output &&
+ grep "^sub$" output >sub-output &&
test_line_count = 2 sub-output &&
- ! grep file output
+ ! grep "^file$" output
)
'
@@ -521,8 +521,8 @@ run_dir_diff_test 'difftool --dir-diff from subdirectory with GIT_DIR set' '
cd sub &&
git difftool --dir-diff $symlinks --extcmd ls \
branch -- sub >output &&
- grep sub output &&
- ! grep file output
+ grep "^sub$" output &&
+ ! grep "^file$" output
)
'
@@ -530,7 +530,7 @@ run_dir_diff_test 'difftool --dir-diff when worktree file is missing' '
test_when_finished git reset --hard &&
rm file2 &&
git difftool --dir-diff $symlinks --extcmd ls branch main >output &&
- grep file2 output
+ grep "^file2$" output
'
run_dir_diff_test 'difftool --dir-diff with unmerged files' '