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

[PATCH] git-diff: add a test for git diff --quiet -w

From
Larry D'Anna <larry@elder-gods.org>
Date
Feb 22, 2010, 02:58 UTC
Message-ID
<1266807524-28487-1-git-send-email-larry@elder-gods.org>
This patch adds two test cases for:
6977c25 git diff --quiet -w: check and report the status
Signed-off-by: Larry D'Anna <larry@elder-gods.org>
---
 t/t4017-diff-retval.sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh
index 60dd201..14f80ca 100755
--- a/t/t4017-diff-retval.sh
+++ b/t/t4017-diff-retval.sh
@@ -5,6 +5,9 @@ test_description='Return value of diffs'
 . ./test-lib.sh
 
 test_expect_success 'setup' '
+	echo "1 " >a &&
+	git add . &&
+	git commit -m zeroth &&
 	echo 1 >a &&
 	git add . &&
 	git commit -m first &&
@@ -13,6 +16,16 @@ test_expect_success 'setup' '
 	git commit -a -m second
 '
 
+test_expect_success 'git diff --quiet -w  HEAD^^ HEAD^' '
+	git diff --quiet -w HEAD^^ HEAD^
+	test $? = 0
+'
+
+test_expect_success 'git diff --quiet -w  HEAD^ HEAD' '
+	git diff --quiet -w HEAD^ HEAD
+	test $? = 1
+'
+
 test_expect_success 'git diff-tree HEAD^ HEAD' '
 	git diff-tree --exit-code HEAD^ HEAD
 	test $? = 1
-- 
1.7.0.rc2.40.g7d8aa
Next: Junio C Hamano
Message 1 of 2 in “git-diff: add a test for git diff --quiet -w”
  1. git-diff: add a test for git diff --quiet -wLarry D'Anna, Feb 22, 2010
  2. Junio C HamanoFeb 22, 2010

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.