summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-05-19 07:45:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-19 07:45:30 (GMT)
commit85ac27e04fd0cf1d086028e87f69ffb498c1451b (patch)
treee4486ede9a0d92509bb49a6435e7cb126be6bf99 /t/t7800-difftool.sh
parentfed9391fba44417d6d6559795c0f0194882f12c1 (diff)
parent6c22d715e7b4067a6865ff3fbceab991d0042c12 (diff)
downloadgit-85ac27e04fd0cf1d086028e87f69ffb498c1451b.zip
git-85ac27e04fd0cf1d086028e87f69ffb498c1451b.tar.gz
git-85ac27e04fd0cf1d086028e87f69ffb498c1451b.tar.bz2
Merge branch 'dl/difftool-mergetool'
Update "git difftool" and "git mergetool" so that the combinations of {diff,merge}.{tool,guitool} configuration variables serve as fallback settings of each other in a sensible order. * dl/difftool-mergetool: difftool: fallback on merge.guitool difftool: make --gui, --tool and --extcmd mutually exclusive mergetool: fallback to tool when guitool unavailable mergetool--lib: create gui_mode function mergetool: use get_merge_tool function t7610: add mergetool --gui tests t7610: unsuppress output
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 480dd06..6bac9ed 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -279,11 +279,27 @@ test_expect_success 'difftool + mergetool config variables' '
echo branch >expect &&
git difftool --no-prompt branch >actual &&
test_cmp expect actual &&
+ git difftool --gui --no-prompt branch >actual &&
+ test_cmp expect actual &&
# set merge.tool to something bogus, diff.tool to test-tool
test_config merge.tool bogus-tool &&
test_config diff.tool test-tool &&
git difftool --no-prompt branch >actual &&
+ test_cmp expect actual &&
+ git difftool --gui --no-prompt branch >actual &&
+ test_cmp expect actual &&
+
+ # set merge.tool, diff.tool to something bogus, merge.guitool to test-tool
+ test_config diff.tool bogus-tool &&
+ test_config merge.guitool test-tool &&
+ git difftool --gui --no-prompt branch >actual &&
+ test_cmp expect actual &&
+
+ # set merge.tool, diff.tool, merge.guitool to something bogus, diff.guitool to test-tool
+ test_config merge.guitool bogus-tool &&
+ test_config diff.guitool test-tool &&
+ git difftool --gui --no-prompt branch >actual &&
test_cmp expect actual
'
@@ -715,4 +731,12 @@ test_expect_success 'outside worktree' '
test_cmp expect actual
'
+test_expect_success 'difftool --gui, --tool and --extcmd are mutually exclusive' '
+ difftool_test_setup &&
+ test_must_fail git difftool --gui --tool=test-tool &&
+ test_must_fail git difftool --gui --extcmd=cat &&
+ test_must_fail git difftool --tool=test-tool --extcmd=cat &&
+ test_must_fail git difftool --gui --tool=test-tool --extcmd=cat
+'
+
test_done