summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-12-21 21:57:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-22 00:06:21 (GMT)
commit36bae1dc0ee777aa529dd955f2e619281265f262 (patch)
tree07a56e06c48b599b948e235ca0cd626232dc193e /builtin/add.c
parentd2a233cb8b9e0f7210df68c35e751e00419a8488 (diff)
downloadgit-36bae1dc0ee777aa529dd955f2e619281265f262.zip
git-36bae1dc0ee777aa529dd955f2e619281265f262.tar.gz
git-36bae1dc0ee777aa529dd955f2e619281265f262.tar.bz2
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>
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 0060162..b0d6891 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -201,6 +201,10 @@ int run_add_interactive(const char *revision, const char *patch_mode,
if (!strcmp(patch_mode, "--patch"))
mode = ADD_P_ADD;
+ else if (!strcmp(patch_mode, "--patch=stash"))
+ mode = ADD_P_STASH;
+ else if (!strcmp(patch_mode, "--patch=reset"))
+ mode = ADD_P_RESET;
else
die("'%s' not yet supported in the built-in add -p",
patch_mode);