summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-12-19 22:45:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-12-19 22:45:33 (GMT)
commitafe0e2a391665c01daae78d8f8a9a105420b0218 (patch)
treeea929bc1bdaff887cf0df53e102bec6979162e14 /t
parentc89606fa9043910c5f467eb0d152df1c463710be (diff)
parent853e10c19755669bd4695b1d9fd81f3278466727 (diff)
downloadgit-afe0e2a391665c01daae78d8f8a9a105420b0218.zip
git-afe0e2a391665c01daae78d8f8a9a105420b0218.tar.gz
git-afe0e2a391665c01daae78d8f8a9a105420b0218.tar.bz2
Merge branch 'da/difftool-dir-diff-fix'
"git difftool --dir-diff" had a minor regression when started from a subdirectory, which has been fixed. * da/difftool-dir-diff-fix: difftool: fix dir-diff index creation when in a subdirectory
Diffstat (limited to 't')
-rwxr-xr-xt/t7800-difftool.sh44
1 files changed, 41 insertions, 3 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 70a2de4..99d4123 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -374,6 +374,7 @@ test_expect_success PERL 'setup change in subdirectory' '
echo master >sub/sub &&
git add sub/sub &&
git commit -m "added sub/sub" &&
+ git tag v1 &&
echo test >>file &&
echo test >>sub/sub &&
git add file sub/sub &&
@@ -409,12 +410,49 @@ run_dir_diff_test 'difftool --dir-diff ignores --prompt' '
grep file output
'
-run_dir_diff_test 'difftool --dir-diff from subdirectory' '
+run_dir_diff_test 'difftool --dir-diff branch from subdirectory' '
(
cd sub &&
git difftool --dir-diff $symlinks --extcmd ls branch >output &&
- grep sub output &&
- grep file output
+ # "sub" must only exist in "right"
+ # "file" and "file2" must be listed in both "left" and "right"
+ test "1" = $(grep sub output | wc -l) &&
+ test "2" = $(grep file"$" output | wc -l) &&
+ test "2" = $(grep file2 output | wc -l)
+ )
+'
+
+run_dir_diff_test 'difftool --dir-diff v1 from subdirectory' '
+ (
+ cd sub &&
+ git difftool --dir-diff $symlinks --extcmd ls v1 >output &&
+ # "sub" and "file" exist in both v1 and HEAD.
+ # "file2" is unchanged.
+ test "2" = $(grep sub output | wc -l) &&
+ test "2" = $(grep file output | wc -l) &&
+ test "0" = $(grep file2 output | wc -l)
+ )
+'
+
+run_dir_diff_test 'difftool --dir-diff branch from subdirectory w/ pathspec' '
+ (
+ cd sub &&
+ git difftool --dir-diff $symlinks --extcmd ls branch -- .>output &&
+ # "sub" only exists in "right"
+ # "file" and "file2" must not be listed
+ test "1" = $(grep sub output | wc -l) &&
+ test "0" = $(grep file output | wc -l)
+ )
+'
+
+run_dir_diff_test 'difftool --dir-diff v1 from subdirectory w/ pathspec' '
+ (
+ cd sub &&
+ git difftool --dir-diff $symlinks --extcmd ls v1 -- .>output &&
+ # "sub" exists in v1 and HEAD
+ # "file" is filtered out by the pathspec
+ test "2" = $(grep sub output | wc -l) &&
+ test "0" = $(grep file output | wc -l)
)
'