diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-10-12 15:53:46 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-10-12 16:06:49 -0700 |
commit | 5de7166d46d25fed3b8a181c3842cf4350ecdea4 (patch) | |
tree | e8a5471da611530d03a189b8f2000d6139c0af4b /test-regex.c | |
parent | Git 1.7.11.7 (diff) | |
download | tgif-5de7166d46d25fed3b8a181c3842cf4350ecdea4.tar.xz |
apply.c:update_pre_post_images(): the preimage can be truncated
5166714 (apply: Allow blank context lines to match beyond EOF,
2010-03-06) and then later 0c3ef98 (apply: Allow blank *trailing*
context lines to match beyond EOF, 2010-04-08) taught "git apply"
to trim new blank lines at the end in the patch text when matching
the contents being patched and the preimage recorded in the patch,
under --whitespace=fix mode.
When a preimage is modified to match the current contents in
preparation for such a "fixed" patch application, the context lines
in the postimage must be updated to match (otherwise, it would
reintroduce whitespace breakages), and update_pre_post_images()
function is responsible for doing this. However, this function was
not updated to take into account a case where the removal of
trailing blank lines reduces the number of lines in the preimage,
and triggered an assertion error.
The logic to fix the postimage by copying the corrected context
lines from the preimage was not prepared to handle this case,
either, but it was protected by the assert() and only got exposed
when the assertion is corrected.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-regex.c')
0 files changed, 0 insertions, 0 deletions