Skip to content

Commit d50b2c7

Browse files
davvidgitster
authored andcommitted
t7800: Test difftool passing arguments to diff
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f524129 commit d50b2c7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

t/t7800-difftool.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ test_expect_success PERL 'difftool ignores bad --tool values' '
8383
test "$diff" = ""
8484
'
8585

86+
test_expect_success PERL 'difftool forwards arguments to diff' '
87+
>for-diff &&
88+
git add for-diff &&
89+
echo changes>for-diff &&
90+
git add for-diff &&
91+
diff=$(git difftool --cached --no-prompt -- for-diff) &&
92+
test "$diff" = "" &&
93+
git reset -- for-diff &&
94+
rm for-diff
95+
'
96+
8697
test_expect_success PERL 'difftool honors --gui' '
8798
git config merge.tool bogus-tool &&
8899
git config diff.tool bogus-tool &&

0 commit comments

Comments
 (0)