]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7800-difftool.sh
git-difftool: Add '--gui' for selecting a GUI tool
[thirdparty/git.git] / t / t7800-difftool.sh
index 707a0f54ae85a6095c57e2598bb5cd3fd83bceb3..9bf6c98c54f368dfc837a8c5c374021269f20707 100755 (executable)
@@ -19,6 +19,7 @@ remove_config_vars()
 {
        # Unset all config variables used by git-difftool
        git config --unset diff.tool
+       git config --unset diff.guitool
        git config --unset difftool.test-tool.cmd
        git config --unset difftool.prompt
        git config --unset merge.tool
@@ -77,6 +78,17 @@ test_expect_success 'difftool ignores bad --tool values' '
        test "$diff" = ""
 '
 
+test_expect_success 'difftool honors --gui' '
+       git config merge.tool bogus-tool &&
+       git config diff.tool bogus-tool &&
+       git config diff.guitool 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