diff --check: do not discard error status upon seeing a good line

"git diff --check" should return non-zero when there was any whitespace
error but the code only paid attention to the error status of the last
new line in the patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2008-06-26 13:16:33 -07:00
parent e636106c76
commit 18374e584c
2 changed files with 13 additions and 3 deletions

View File

@ -105,4 +105,12 @@ test_expect_success '--check with --no-pager returns 2 for dirty difference' '
'
test_expect_success 'check should test not just the last line' '
echo "" >>a &&
git --no-pager diff --check
test $? = 2
'
test_done