summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2009-12-22 21:27:14 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-03 00:29:35 -0800
commit4cefa495ca91ad833084ebf3f73c77997920ae9b (patch)
tree6ee3a42ff6cf26d688a82e1d494c11a0d9c9fdef /t/t7800-difftool.sh
parent23218bbd2ea7f919b93245489e544a55165ec466 (diff)
downloadgit-4cefa495ca91ad833084ebf3f73c77997920ae9b.tar.gz
git-difftool: Add '--gui' for selecting a GUI tool
Users might prefer to have git-difftool use a different tool when run from a Git GUI. This teaches git-difftool to honor 'diff.guitool' when the '--gui' option is specified. This allows users to configure their preferred command-line diff tool in 'diff.tool' and a GUI diff tool in 'diff.guitool'. Reference: http://article.gmane.org/gmane.comp.version-control.git/133386 Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 707a0f54ae..9bf6c98c54 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -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