git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t7800: Test difftool passing arguments to diff

From
David Aguilar <davvid@gmail.com>
Date
Mar 17, 2012, 03:54 UTC
Message-ID
<1331956477-61346-1-git-send-email-davvid@gmail.com>

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>
---
 t/t7800-difftool.sh |   11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 4fb4c93..2763d79 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -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 &&
-- 
1.7.10.rc1.22.gf5241.dirty
Message 1 of 1 in “t7800: Test difftool passing arguments to diff”
  1. t7800: Test difftool passing arguments to diffDavid Aguilar, Mar 17, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.