Code

Merge branch 'da/difftool-test'
authorJunio C Hamano <gitster@pobox.com>
Mon, 16 Apr 2012 05:52:04 +0000 (22:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Apr 2012 05:52:04 +0000 (22:52 -0700)
Makes sure "difftool" options can be given in any order.

By David Aguilar
* da/difftool-test:
  t7800: Test difftool passing arguments to diff

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 &&