t3701: add failing test for pathological context lines
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Mon, 19 Feb 2018 11:29:06 +0000 (11:29 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Feb 2018 18:17:14 +0000 (10:17 -0800)
commita54cafabf341fd034db547a90348c8924c5be1e8
tree0b04dca8cb72ee2dba9a247e442ff52cb21f1e22
parent07deb54054f30bcb98698e55324306d441589f88
t3701: add failing test for pathological context lines

When a hunk is skipped by add -i the offsets of subsequent hunks are
not adjusted to account for any missing insertions due to the skipped
hunk. Most of the time this does not matter as apply uses the context
lines to apply the subsequent hunks in the correct place, however in
pathological cases the context lines will match at the now incorrect
offset and the hunk will be applied in the wrong place. The offsets of
hunks following an edited hunk that has had the number of insertions
or deletions changed also need to be updated in the same way. Add
failing tests to demonstrate this.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3701-add-interactive.sh