push: rename config variable for more general use
[gitweb.git] / t / t7800-difftool.sh
index bbe71e5f73a0b1a95c8afc4365a8b7c93bfcf40d..eb1d3f85b59b2e74231f0285fc4e90d95d0658fa 100755 (executable)
@@ -76,6 +76,17 @@ test_expect_success PERL 'custom commands' '
        test "$diff" = "branch"
 '
 
+# Ensures that a custom difftool.<tool>.cmd overrides built-ins
+test_expect_success PERL 'custom commands override built-ins' '
+       restore_test_defaults &&
+       git config difftool.defaults.cmd "cat \$REMOTE" &&
+
+       diff=$(git difftool --tool defaults --no-prompt branch) &&
+       test "$diff" = "master" &&
+
+       git config --unset difftool.defaults.cmd
+'
+
 # Ensures that git-difftool ignores bogus --tool values
 test_expect_success PERL 'difftool ignores bad --tool values' '
        diff=$(git difftool --no-prompt --tool=bad-tool branch)
@@ -83,6 +94,17 @@ test_expect_success PERL 'difftool ignores bad --tool values' '
        test "$diff" = ""
 '
 
+test_expect_success PERL 'difftool forwards arguments to diff' '
+       >for-diff &&
+       git add for-diff &&
+       echo changes>for-diff &&
+       git add for-diff &&
+       diff=$(git difftool --cached --no-prompt -- for-diff) &&
+       test "$diff" = "" &&
+       git reset -- for-diff &&
+       rm for-diff
+'
+
 test_expect_success PERL 'difftool honors --gui' '
        git config merge.tool bogus-tool &&
        git config diff.tool bogus-tool &&