git-diff: add a test for git diff --quiet -w

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Larry D'Anna 2010-02-21 21:58:44 -05:00 committed by Junio C Hamano
parent 6977c250ac
commit 1caaf225f8

View file

@ -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,18 @@ 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_expect_success 'git diff --quiet HEAD^^ HEAD^' '
test_must_fail git diff --quiet HEAD^^ HEAD^
'
test_expect_success 'git diff --quiet -w HEAD^ HEAD' '
test_must_fail git diff --quiet -w HEAD^ HEAD
'
test_expect_success 'git diff-tree HEAD^ HEAD' '
git diff-tree --exit-code HEAD^ HEAD
test $? = 1