]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t7800-difftool.sh
push: mention "git pull" in error message for non-fast forwards
[git.git] / t / t7800-difftool.sh
index fad54722575b70345d42628702c3519d6d413fae..196827e7eacf0584379630f528fb7a4400f2b865 100755 (executable)
@@ -11,7 +11,7 @@ Testing basic diff tool invocation
 . ./test-lib.sh
 
 if ! test_have_prereq PERL; then
-       say 'skipping difftool tests, perl not available'
+       skip_all='skipping difftool tests, perl not available'
        test_done
 fi
 
@@ -27,6 +27,7 @@ remove_config_vars()
        git config --unset difftool.prompt
        git config --unset merge.tool
        git config --unset mergetool.test-tool.cmd
+       git config --unset mergetool.prompt
        return 0
 }
 
@@ -91,6 +92,15 @@ test_expect_success 'difftool honors --gui' '
        restore_test_defaults
 '
 
+test_expect_success 'difftool --gui works without configured diff.guitool' '
+       git config diff.tool test-tool &&
+
+       diff=$(git difftool --no-prompt --gui branch) &&
+       test "$diff" = "branch" &&
+
+       restore_test_defaults
+'
+
 # Specify the diff tool using $GIT_DIFF_TOOL
 test_expect_success 'GIT_DIFF_TOOL variable' '
        git config --unset diff.tool
@@ -159,6 +169,17 @@ test_expect_success 'difftool.prompt config variable is false' '
        restore_test_defaults
 '
 
+# Test that we don't have to pass --no-prompt when mergetool.prompt is false
+test_expect_success 'difftool merge.prompt = false' '
+       git config --unset difftool.prompt
+       git config mergetool.prompt false &&
+
+       diff=$(git difftool branch) &&
+       test "$diff" = "branch" &&
+
+       restore_test_defaults
+'
+
 # Test that the -y flag can override difftool.prompt = true
 test_expect_success 'difftool.prompt can overridden with -y' '
        git config difftool.prompt true &&