From 52628f94fc35f57f0b3c54e4f849e490bfa44449 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 21 Dec 2019 21:57:14 +0000 Subject: built-in add -p: implement the "checkout" patch modes This patch teaches the built-in `git add -p` machinery all the tricks it needs to know in order to act as the work horse for `git checkout -p`. Apart from the minor changes (slightly reworded messages, different `diff` and `apply --check` invocations), it requires a new function to actually apply the changes, as `git checkout -p` is a bit special in that respect: when the desired changes do not apply to the index, but apply to the work tree, Git does not fail straight away, but asks the user whether to apply the changes to the worktree at least. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- add-interactive.h | 1 + 1 file changed, 1 insertion(+) (limited to 'add-interactive.h') diff --git a/add-interactive.h b/add-interactive.h index 1f6a61326e..77907f6e21 100644 --- a/add-interactive.h +++ b/add-interactive.h @@ -27,6 +27,7 @@ enum add_p_mode { ADD_P_ADD, ADD_P_STASH, ADD_P_RESET, + ADD_P_CHECKOUT, }; int run_add_p(struct repository *r, enum add_p_mode mode, -- cgit v1.3-5-g9baa