diff options
Diffstat (limited to 'builtin-add.c')
-rw-r--r-- | builtin-add.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/builtin-add.c b/builtin-add.c index f306f82b16..17641b433d 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -6,10 +6,11 @@ #include "cache.h" #include "builtin.h" #include "dir.h" +#include "exec_cmd.h" #include "cache-tree.h" static const char builtin_add_usage[] = -"git-add [-n] [-v] <filepattern>..."; +"git-add [-n] [-v] [--interactive] [--] <filepattern>..."; static void prune_directory(struct dir_struct *dir, const char **pathspec, int prefix) { @@ -87,6 +88,20 @@ int cmd_add(int argc, const char **argv, const char *prefix) int verbose = 0, show_only = 0; const char **pathspec; struct dir_struct dir; + int add_interactive = 0; + + for (i = 1; i < argc; i++) { + if (!strcmp("--interactive", argv[i])) + add_interactive++; + } + if (add_interactive) { + const char *args[] = { "add--interactive", NULL }; + + if (add_interactive != 1 || argc != 2) + die("add --interactive does not take any parameters"); + execv_git_cmd(args); + exit(1); + } git_config(git_default_config); |