]> git.ipfire.org Git - thirdparty/git.git/commit
add-patch: allow all-or-none application of patches
authorAbraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Sat, 14 Feb 2026 11:06:06 +0000 (12:06 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Feb 2026 18:48:37 +0000 (10:48 -0800)
commitd3cce5e76fcbce00d33013424bece954f11fa2f3
tree818ba5d012b7c4c06970fe27ee6772c4a81680f7
parent57088095e90a940d232e36594c6fa761f283d35d
add-patch: allow all-or-none application of patches

When the flag `--no-auto-advance` is used with `--patch`,
if the user has decided `USE` on a hunk in a file, goes to another
file, and then returns to this file and changes the previous
decision on the hunk to `SKIP`, because the patch has already
been applied, the last decision is not registered and the now
SKIPPED hunk is still applied.

Move the logic for applying patches into a function so that we can
reuse this logic to implement the all or non application of the patches
after the user is done with the hunk selection.

Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-patch.c