author | Björn Gustavsson <bgustavsson@gmail.com> | |
Thu, 8 Apr 2010 04:14:31 +0000 (06:14 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 8 Apr 2010 06:46:23 +0000 (23:46 -0700) | ||
commit | 0c3ef984fa2d4a42be787e168cfb189d15b00919 | |
tree | d6e076b15020477dad29a433c0212268f49511d5 | tree | snapshot |
parent | 59f5ced65b46370a121916593cce7fcd210a15df | commit | diff |
apply: Allow blank *trailing* context lines to match beyond EOF
In 51667147be, "git apply --whitespace=fix" was extended to
allow a blank context line to match beyond the end of the file,
but only if the context line was in the leading part of the
hunk (i.e. the hunk inserted additional contents at the end
of the file).
Drop the restriction that the context line must be in the
leading part of the hunk, thus allowing a file to be changed
from:
a
(blank line)
to:
b
a
(blank line)
Note that the blank line will be kept, because "--whitespace=fix"
only removes trailing blank lines that a hunk would add, never
trailing blank lines in the context.
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In 51667147be, "git apply --whitespace=fix" was extended to
allow a blank context line to match beyond the end of the file,
but only if the context line was in the leading part of the
hunk (i.e. the hunk inserted additional contents at the end
of the file).
Drop the restriction that the context line must be in the
leading part of the hunk, thus allowing a file to be changed
from:
a
(blank line)
to:
b
a
(blank line)
Note that the blank line will be kept, because "--whitespace=fix"
only removes trailing blank lines that a hunk would add, never
trailing blank lines in the context.
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-apply.c | diff | blob | history | |
t/t4124-apply-ws-rule.sh | diff | blob | history |