]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7800-difftool.sh
Merge branch 'jk/delta-islands-progress-fix' into maint
[thirdparty/git.git] / t / t7800-difftool.sh
index bb9a7f4ff91120424e300f4ced821a9217b5e34e..6bac9ed180e7342b34401b2d6af9e83b4472f08d 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
 '
 
@@ -705,4 +721,22 @@ test_expect_success SYMLINKS 'difftool --dir-diff handles modified symlinks' '
        test_cmp expect actual
 '
 
+test_expect_success 'outside worktree' '
+       echo 1 >1 &&
+       echo 2 >2 &&
+       test_expect_code 1 nongit git \
+               -c diff.tool=echo -c difftool.echo.cmd="echo \$LOCAL \$REMOTE" \
+               difftool --no-prompt --no-index ../1 ../2 >actual &&
+       echo "../1 ../2" >expect &&
+       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