From 18374e584ca7a820457c1d83ee99867c216e7b75 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 26 Jun 2008 13:16:33 -0700 Subject: 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 --- t/t4017-diff-retval.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't') diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh index dc0b7126c..0d0fb87f5 100755 --- a/t/t4017-diff-retval.sh +++ b/t/t4017-diff-retval.sh @@ -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 -- cgit v1.2.1