pretty: --format output should honor logOutputEncoding
[gitweb.git] / t / t7800-difftool.sh
index df443a981d8bcbcad8af51463e1d13b1c4177bb5..d46f0411bd9a08b38035c8fb5ca611723b8baed2 100755 (executable)
@@ -318,33 +318,51 @@ 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
        )
 '
 
+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 master >output &&
+       grep file2 output
+'
+
 write_script .git/CHECK_SYMLINKS <<\EOF
 for f in file file2 sub/sub
 do