summaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-25 10:10:10 -0800
committerJunio C Hamano <gitster@pobox.com>2007-11-25 10:23:13 -0800
commit3f061887c562b20d3ed3d1f764462cf986a1ad12 (patch)
tree636a0f9c085aac7ba539ef2ace03b3081481891a /builtin-commit.c
parent324ccbd6a09816af830b22b02bbeb06349141849 (diff)
downloadgit-3f061887c562b20d3ed3d1f764462cf986a1ad12.tar.gz
add -i: Fix running from a subdirectory
This fixes the pathspec interactive_add() passes to the underlying git-add--interactive helper. When the command was run from a subdirectory, cmd_add() already has gone up to the toplevel of the work tree, and the helper will be spawned from there. The pathspec given on the command line from the user needs to be adjusted for this. This adds "validate_pathspec()" function in the callchain, but it does not validate yet. The function can be changed to barf if there are unmatching pathspec given by the user, but that is not strictly necessary. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index 5d27102a62..45e51b1d5f 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -165,7 +165,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
const char **pathspec = NULL;
if (interactive) {
- interactive_add(argc, argv);
+ interactive_add(argc, argv, prefix);
commit_style = COMMIT_AS_IS;
return get_index_file();
}