summaryrefslogtreecommitdiff
path: root/t/t4015-diff-whitespace.sh
diff options
context:
space:
mode:
authorGreg Bacon <gbacon@dbresearch.net>2009-11-19 21:12:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-21 06:00:36 (GMT)
commit3e97c7c6af2901cec63bf35fcd43ae3472e24af8 (patch)
treee71fd65ec0cd0c2b1150f1e48571795a444f1388 /t/t4015-diff-whitespace.sh
parente36e6c00cd60130f8792319a5aa0f56d2da68e14 (diff)
downloadgit-3e97c7c6af2901cec63bf35fcd43ae3472e24af8.zip
git-3e97c7c6af2901cec63bf35fcd43ae3472e24af8.tar.gz
git-3e97c7c6af2901cec63bf35fcd43ae3472e24af8.tar.bz2
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>
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 8dd147d..90f3342 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -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 &&