Skip to content

Commit

Permalink
git-diff: add a test for git diff --quiet -w
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Larry D'Anna authored and Junio C Hamano committed Feb 22, 2010
1 parent 6977c25 commit 1caaf22
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions t/t4017-diff-retval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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
Expand Down

0 comments on commit 1caaf22

Please sign in to comment.