summaryrefslogtreecommitdiff
path: root/t/t4015-diff-whitespace.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-06-14 07:26:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-06-14 18:39:16 (GMT)
commit74f16b0c6fece88f585f9556fa1d3a7406e7a42e (patch)
tree69eeae4a23e0842bd7a9cc936a76554e257be4bd /t/t4015-diff-whitespace.sh
parent3b2eb186bb738a374d9325b18710b19ec270e55f (diff)
downloadgit-74f16b0c6fece88f585f9556fa1d3a7406e7a42e.zip
git-74f16b0c6fece88f585f9556fa1d3a7406e7a42e.tar.gz
git-74f16b0c6fece88f585f9556fa1d3a7406e7a42e.tar.bz2
mask necessary whitespace policy violations in test scripts
All of these violations are necessary parts of the tests (which are generally checking the behavior of trailing whitespace, or contain diff fragments with empty lines). Our solution is two-fold: 1. Process input with whitespace problems using tr. This has the added bonus that it becomes very obvious where the bogus whitespace is intended to go. 2. Move large diff fragments into their own supplemental files. This gets rid of the whitespace problem, since supplemental files are not checked, and it also makes the test script a bit easier to read. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index ca0302f..b7cc6b2 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -62,16 +62,16 @@ EOF
git update-index x
-cat << EOF > x
+tr '_' ' ' << EOF > x
whitespace at beginning
whitespace change
white space in the middle
-whitespace at end
+whitespace at end__
unchanged line
CR at end
EOF
-tr 'Q' '\015' << EOF > expect
+tr 'Q_' '\015 ' << EOF > expect
diff --git a/x b/x
index d99af23..8b32fb5 100644
--- a/x
@@ -84,7 +84,7 @@ index d99af23..8b32fb5 100644
+ whitespace at beginning
+whitespace change
+white space in the middle
-+whitespace at end
++whitespace at end__
unchanged line
-CR at endQ
+CR at end