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:
@ -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
|
||||
|
Reference in New Issue
Block a user