diff options
author | Björn Gustavsson <bgustavsson@gmail.com> | 2010-03-06 15:30:42 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-06 23:53:00 -0800 |
commit | 51667147be4a5aed6d735d43630ce36b74134eee (patch) | |
tree | 72603b99de300d134f236efc6e3959b8ce4e826c /t/t3417-rebase-whitespace-fix.sh | |
parent | apply: Remove the quick rejection test (diff) | |
download | tgif-51667147be4a5aed6d735d43630ce36b74134eee.tar.xz |
apply: Allow blank context lines to match beyond EOF
"git apply --whitespace=fix" will not always succeed when used
on a series of patches in the following circumstances:
* One patch adds a blank line at the end of a file. (Since
--whitespace=fix is used, the blank line will *not* be added.)
* The next patch adds non-blank lines after the blank line
introduced in the first patch. That patch will not apply
because the blank line that is expected to be found at end
of the file is no longer there.
A patch series that starts by deleting lines at the end
will fail in a similar way.
Fix this problem by allowing a blank context line at the beginning
of a hunk to match if parts of it falls beyond end of the file.
We still require that at least one non-blank context line match
before the end of the file.
If the --ignore-space-change option is given (as well as the
--whitespace=fix option), blank context lines falling beyond the end
of the file will be copied unchanged to the target file (i.e. they
will have the same line terminators and extra spaces will not be
removed).
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3417-rebase-whitespace-fix.sh')
0 files changed, 0 insertions, 0 deletions