Code

t7800: Test difftool passing arguments to diff
authorDavid Aguilar <davvid@gmail.com>
Sat, 17 Mar 2012 03:54:37 +0000 (20:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Mar 2012 16:41:34 +0000 (09:41 -0700)
git-difftool relies on the ability to forward unknown arguments
to the git-diff command.  Add a test to ensure that this works
as advertised.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7800-difftool.sh

index 4fb4c9384a0045d3b041d627e9d814637d9268e2..2763d795f0ae94c56a77fb630210df0928df468e 100755 (executable)
@@ -83,6 +83,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 &&