built-in add -p: implement the "stash" and "reset" patch modes

The `git stash` and `git reset` commands support a `--patch` option, and
both simply hand off to `git add -p` to perform that work. Let's teach
the built-in version of that command to be able to perform that work, too.

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:11 +00:00
committed by Junio C Hamano
parent d2a233cb8b
commit 36bae1dc0e
3 changed files with 85 additions and 4 deletions

View File

@@ -25,6 +25,8 @@ int run_add_i(struct repository *r, const struct pathspec *ps);
enum add_p_mode {
ADD_P_ADD,
ADD_P_STASH,
ADD_P_RESET,
};
int run_add_p(struct repository *r, enum add_p_mode mode,