aboutsummaryrefslogtreecommitdiff
path: root/builtin-add.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-25 01:31:17 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-25 01:31:17 -0800
commit6f38e0372266b5d674972e7039f8bd4156589558 (patch)
treeffe2f2125316c8f7da59856a67b1dce6e8817e3e /builtin-add.c
parente036c90a913889dfa8097ebe73b619370e0c6f32 (diff)
parent6a5ad23de6aa95b35d90d631062e5a353e59d3f2 (diff)
downloadgit-6f38e0372266b5d674972e7039f8bd4156589558.tar.gz
git-6f38e0372266b5d674972e7039f8bd4156589558.tar.xz
Merge branch 'jc/git-add--interactive'
* jc/git-add--interactive: git-add --interactive: add documentation git-add --interactive: hunk splitting git-add --interactive
Diffstat (limited to 'builtin-add.c')
-rw-r--r--builtin-add.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/builtin-add.c b/builtin-add.c
index f306f82b1..17641b433 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);