author | Junio C Hamano <gitster@pobox.com> | |
Fri, 4 Sep 2009 06:39:43 +0000 (23:39 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 4 Sep 2009 18:50:27 +0000 (11:50 -0700) | ||
commit | 467babf8d059caee9587567452fc8b46505b4e67 | |
tree | 9038af337fc9d8ea487e0e1420c3080604dbe200 | tree | snapshot |
parent | 5b5061efd88e1d113a4484369dfab654b43364de | commit | diff |
diff --whitespace=warn/error: fix blank-at-eof check
The "diff --check" logic used to share the same issue as the one fixed for
"git apply" earlier in this series, in that a patch that adds new blank
lines at end could appear as
@@ -l,5 +m,7 @@$
_context$
_context$
-deleted$
+$
+$
+$
_$
_$
where _ stands for SP and $ shows a end-of-line. Instead of looking at
each line in the patch in the callback, simply count the blank lines from
the end in two versions, and notice the presence of new ones.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The "diff --check" logic used to share the same issue as the one fixed for
"git apply" earlier in this series, in that a patch that adds new blank
lines at end could appear as
@@ -l,5 +m,7 @@$
_context$
_context$
-deleted$
+$
+$
+$
_$
_$
where _ stands for SP and $ shows a end-of-line. Instead of looking at
each line in the patch in the callback, simply count the blank lines from
the end in two versions, and notice the presence of new ones.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | diff | blob | history | |
t/t4015-diff-whitespace.sh | diff | blob | history |