No diff -b/-w output for all-whitespace changes

Change git-diff's whitespace-ignoring modes to generate
output only if a non-empty patch results, which git-apply
rejects.

Update the tests to look for the new behavior.

Signed-off-by: Greg Bacon <gbacon@dbresearch.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Greg Bacon
2009-11-19 15:12:24 -06:00
committed by Junio C Hamano
parent e36e6c00cd
commit 3e97c7c6af
2 changed files with 39 additions and 10 deletions

View File

@ -93,8 +93,6 @@ git diff > out
test_expect_success 'another test, without options' 'test_cmp expect out'
cat << EOF > expect
diff --git a/x b/x
index d99af23..8b32fb5 100644
EOF
git diff -w > out
test_expect_success 'another test, with -w' 'test_cmp expect out'
@ -386,6 +384,18 @@ test_expect_success 'checkdiff allows new blank lines' '
git diff --check
'
cat <<EOF >expect
EOF
test_expect_success 'whitespace-only changes not reported' '
git reset --hard &&
echo >x "hello world" &&
git add x &&
git commit -m "hello 1" &&
echo >x "hello world" &&
git diff -b >actual &&
test_cmp expect actual
'
test_expect_success 'combined diff with autocrlf conversion' '
git reset --hard &&