Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-12-22 00:57:11 +0300
committerJunio C Hamano <gitster@pobox.com>2019-12-22 03:06:21 +0300
commit36bae1dc0ee777aa529dd955f2e619281265f262 (patch)
tree07a56e06c48b599b948e235ca0cd626232dc193e /builtin/add.c
parentd2a233cb8b9e0f7210df68c35e751e00419a8488 (diff)
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 006016267e2..b0d68914794 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);