]> git.ipfire.org Git - thirdparty/git.git/commit
add-patch: update hunk splitability after editing
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Thu, 25 Sep 2025 15:10:38 +0000 (15:10 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Sep 2025 17:13:23 +0000 (10:13 -0700)
commit732650e263eb6bceda9988a8bbe75f311d908897
tree86e35482235e57aa5eedafc7a7e596edc0f4c52c
parent3b9532dab2fe1db12d5a33c74a0256d03a4c4861
add-patch: update hunk splitability after editing

If, when the user edits a hunk, they change deletion lines into
context lines or vice versa, then the number of hunks that the edited
hunk can be split into may differ from the unedited hunk. This means
that so we should recalculate `hunk->splittable_into` after the hunk
has been edited. In practice users are unlikely to hit this bug as it
is doubtful that a user who has edited a hunk will split it afterwards.

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