Merge branch 'jk/ident-ai-canonname-could-be-null' into maint
[gitweb.git] / t / t7800-difftool.sh
index 42a2929835b5c77e5b3031ce56ad1243afb56971..70a2de461af58119f507a915104ba139dd0245df 100755 (executable)
@@ -124,6 +124,12 @@ test_expect_success PERL 'difftool stops on error with --trust-exit-code' '
        test_cmp expect actual
 '
 
+test_expect_success PERL 'difftool honors exit status if command not found' '
+       test_config difftool.nonexistent.cmd i-dont-exist &&
+       test_config difftool.trustExitCode false &&
+       test_must_fail git difftool -y -t nonexistent branch
+'
+
 test_expect_success PERL 'difftool honors --gui' '
        difftool_test_setup &&
        test_config merge.tool bogus-tool &&
@@ -412,6 +418,20 @@ run_dir_diff_test 'difftool --dir-diff from subdirectory' '
        )
 '
 
+run_dir_diff_test 'difftool --dir-diff from subdirectory with GIT_DIR set' '
+       (
+               GIT_DIR=$(pwd)/.git &&
+               export GIT_DIR &&
+               GIT_WORK_TREE=$(pwd) &&
+               export GIT_WORK_TREE &&
+               cd sub &&
+               git difftool --dir-diff $symlinks --extcmd ls \
+                       branch -- sub >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 &&