Skip to contentSkip to conversation

t7800: Test difftool passing arguments to diff

PATCH New David Aguilar 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 t/t7800-difftool.sh |   11 +++++++++++
 1 file changed, 11 insertions(+)
t/t7800-difftool.sh +11 -0
index 4fb4c93..2763d79 100755
@@ -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 &&
Signature · 1 line
1.7.10.rc1.22.gf5241.dirty