built-in add -p: implement the "worktree" patch modes

This is a straight-forward port of 2f0896ec3a (restore: support
--patch, 2019-04-25) which added support for `git restore -p`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2019-12-21 21:57:15 +00:00
committed by Junio C Hamano
parent 52628f94fc
commit cee6cb7300
3 changed files with 53 additions and 0 deletions

View File

@ -28,6 +28,7 @@ enum add_p_mode {
ADD_P_STASH,
ADD_P_RESET,
ADD_P_CHECKOUT,
ADD_P_WORKTREE,
};
int run_add_p(struct repository *r, enum add_p_mode mode,