summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2013-03-29 11:28:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-29 22:16:40 (GMT)
commite01afdb74b395e63a6ee8feb8cb3a6ee470e2085 (patch)
treecce143c60358a4ad78b15e10bf8f66eaf7bf381a /t/t7800-difftool.sh
parent3caf5a93d8ccbffaccfbae3fe814325682cc95f4 (diff)
downloadgit-e01afdb74b395e63a6ee8feb8cb3a6ee470e2085.zip
git-e01afdb74b395e63a6ee8feb8cb3a6ee470e2085.tar.gz
git-e01afdb74b395e63a6ee8feb8cb3a6ee470e2085.tar.bz2
t7800: run --dir-diff tests with and without symlinks
Currently the difftool --dir-diff tests may or may not use symlinks depending on the operating system on which they are run. In one case this has caused a test failure to be noticed only on Windows when the test also fails on Linux when difftool is invoked with --no-symlinks. Rewrite these tests so that they do not depend on the environment but run explicitly with both --symlinks and --no-symlinks, protecting the --symlinks version with a SYMLINKS prerequisite. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh27
1 files changed, 19 insertions, 8 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index df443a9..a6bd99e 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -318,28 +318,39 @@ test_expect_success PERL 'setup change in subdirectory' '
git commit -m "modified both"
'
-test_expect_success PERL 'difftool -d' '
- git difftool -d --extcmd ls branch >output &&
+run_dir_diff_test () {
+ test_expect_success PERL "$1 --no-symlinks" "
+ symlinks=--no-symlinks &&
+ $2
+ "
+ test_expect_success PERL,SYMLINKS "$1 --symlinks" "
+ symlinks=--symlinks &&
+ $2
+ "
+}
+
+run_dir_diff_test 'difftool -d' '
+ git difftool -d $symlinks --extcmd ls branch >output &&
grep sub output &&
grep file output
'
-test_expect_success PERL 'difftool --dir-diff' '
- git difftool --dir-diff --extcmd ls branch >output &&
+run_dir_diff_test 'difftool --dir-diff' '
+ git difftool --dir-diff $symlinks --extcmd ls branch >output &&
grep sub output &&
grep file output
'
-test_expect_success PERL 'difftool --dir-diff ignores --prompt' '
- git difftool --dir-diff --prompt --extcmd ls branch >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
'
-test_expect_success PERL 'difftool --dir-diff from subdirectory' '
+run_dir_diff_test 'difftool --dir-diff from subdirectory' '
(
cd sub &&
- git difftool --dir-diff --extcmd ls branch >output &&
+ git difftool --dir-diff $symlinks --extcmd ls branch >output &&
grep sub output &&
grep file output
)