difftool: fallback on merge.guitool
[gitweb.git] / t / t7800-difftool.sh
index 668bbee73c8dc58c6ba61c4a8002ed68206d1445..48b74c04346eb061ed414dbb254543a11f87886f 100755 (executable)
@@ -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
 '
 
@@ -557,7 +573,7 @@ test_expect_success SYMLINKS 'difftool --dir-diff --symlink without unstaged cha
        EOF
        git difftool --dir-diff --symlink \
                --extcmd "./.git/CHECK_SYMLINKS" branch HEAD &&
-       test_cmp actual expect
+       test_cmp expect actual
 '
 
 write_script modify-right-file <<\EOF
@@ -705,4 +721,12 @@ test_expect_success SYMLINKS 'difftool --dir-diff handles modified symlinks' '
        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