summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-05-07 20:28:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-07 20:28:44 (GMT)
commitcae097722162c852ab81c50efe8b25a84b6a5dff (patch)
tree270ba0c48a0c8be60c307462247d802b142bd6cc /t/t7800-difftool.sh
parentad799ea37589029256644d5420c1edc29821a8d2 (diff)
parentbf73fc212a159210398b6d46ed5e9101c650e7db (diff)
downloadgit-cae097722162c852ab81c50efe8b25a84b6a5dff.zip
git-cae097722162c852ab81c50efe8b25a84b6a5dff.tar.gz
git-cae097722162c852ab81c50efe8b25a84b6a5dff.tar.bz2
Merge branch 'th/difftool-diffall'
Rolls the two-directory-diff logic from diffall script (in contrib/) into "git difftool" framework. By Tim Henigan * th/difftool-diffall: difftool: print list of valid tools with '--tool-help' difftool: teach difftool to handle directory diffs difftool: eliminate setup_environment function difftool: stop appending '.exe' to git difftool: remove explicit change of PATH difftool: exit(0) when usage is printed difftool: add '--no-gui' option difftool: parse options using Getopt::Long
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 2763d79..9c3e997 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -105,6 +105,19 @@ test_expect_success PERL 'difftool honors --gui' '
restore_test_defaults
'
+test_expect_success PERL 'difftool --gui last setting wins' '
+ git config diff.guitool bogus-tool &&
+ git difftool --no-prompt --gui --no-gui &&
+
+ git config merge.tool bogus-tool &&
+ git config diff.tool bogus-tool &&
+ git config diff.guitool test-tool &&
+ diff=$(git difftool --no-prompt --no-gui --gui branch) &&
+ test "$diff" = "branch" &&
+
+ restore_test_defaults
+'
+
test_expect_success PERL 'difftool --gui works without configured diff.guitool' '
git config diff.tool test-tool &&
@@ -317,4 +330,48 @@ test_expect_success PERL 'say no to the second file' '
echo "$diff" | stdin_doesnot_contain br2
'
+test_expect_success PERL 'difftool --tool-help' '
+ tool_help=$(git difftool --tool-help) &&
+ echo "$tool_help" | stdin_contains tool
+'
+
+test_expect_success PERL 'setup change in subdirectory' '
+ git checkout master &&
+ mkdir sub &&
+ echo master >sub/sub &&
+ git add sub/sub &&
+ git commit -m "added sub/sub" &&
+ echo test >>file &&
+ echo test >>sub/sub &&
+ git add . &&
+ git commit -m "modified both"
+'
+
+test_expect_success PERL 'difftool -d' '
+ diff=$(git difftool -d --extcmd ls branch) &&
+ echo "$diff" | stdin_contains sub &&
+ echo "$diff" | stdin_contains file
+'
+
+test_expect_success PERL 'difftool --dir-diff' '
+ diff=$(git difftool --dir-diff --extcmd ls branch) &&
+ echo "$diff" | stdin_contains sub &&
+ echo "$diff" | stdin_contains file
+'
+
+test_expect_success PERL 'difftool --dir-diff ignores --prompt' '
+ diff=$(git difftool --dir-diff --prompt --extcmd ls branch) &&
+ echo "$diff" | stdin_contains sub &&
+ echo "$diff" | stdin_contains file
+'
+
+test_expect_success PERL 'difftool --dir-diff from subdirectory' '
+ (
+ cd sub &&
+ diff=$(git difftool --dir-diff --extcmd ls branch) &&
+ echo "$diff" | stdin_contains sub &&
+ echo "$diff" | stdin_contains file
+ )
+'
+
test_done