summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba988a8)
raw | patch | inline | side by side (parent: ba988a8)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sun, 3 Dec 2006 18:25:34 +0000 (19:25 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 5 Dec 2006 00:30:54 +0000 (16:30 -0800) |
This is _not_ the same as "treat eol as whitespace", since that would mean
that multiple empty lines would be treated as equal to e.g. a space.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
that multiple empty lines would be treated as equal to e.g. a space.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
t/t4015-diff-whitespace.sh | patch | blob | history | |
xdiff/xutils.c | patch | blob | history |
index 1bc5b7a41295426dfdd0b75aaf7b2ec4226f257a..adf4993bacf05b4ccb0b447910dda6a2c453bc83 100755 (executable)
+ whitespace at beginning
whitespace change
-whitespace in the middle
--whitespace at end
+white space in the middle
-+whitespace at end
+ whitespace at end
unchanged line
--CR at endQ
-+CR at end
+ CR at endQ
EOF
git-diff -b > out
test_expect_success 'another test, with -b' 'diff -u expect out'
diff --git a/xdiff/xutils.c b/xdiff/xutils.c
index 9e4bb47ee97a0fca5120c41365a80531ddb849e4..1b899f32c4b7c3f00c5310a161d0d9afd459f002 100644 (file)
--- a/xdiff/xutils.c
+++ b/xdiff/xutils.c
while (ptr + 1 < top && isspace(ptr[1])
&& ptr[1] != '\n')
ptr++;
- if (flags & XDF_IGNORE_WHITESPACE_CHANGE) {
+ if (flags & XDF_IGNORE_WHITESPACE_CHANGE
+ && ptr[1] != '\n') {
ha += (ha << 5);
ha ^= (unsigned long) ' ';
}