summaryrefslogtreecommitdiff
path: root/builtin-add.c
diff options
context:
space:
mode:
authorSalikh Zakirov <salikh.zakirov@gmail.com>2007-08-15 17:01:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-08-15 21:28:34 (GMT)
commit2ed2c222dfe372385dc562fb5dc246d5595c1eae (patch)
tree9bb5bb65664acc05dc4238793c07e08314f58ae1 /builtin-add.c
parenta4882c27f8b3793d94b03fd503a0c67ad9772cf6 (diff)
downloadgit-2ed2c222dfe372385dc562fb5dc246d5595c1eae.zip
git-2ed2c222dfe372385dc562fb5dc246d5595c1eae.tar.gz
git-2ed2c222dfe372385dc562fb5dc246d5595c1eae.tar.bz2
git-add -u paths... now works from subdirectory
git-add -u also takes the path limiters, but unlike the command without the -u option, the code forgot that it could be invoked from a subdirectory, and did not correctly handle the prefix. Signed-off-by: Salikh Zakirov <salikh@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-add.c')
-rw-r--r--builtin-add.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin-add.c b/builtin-add.c
index a5fae7c..07e3ddf 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -123,12 +123,12 @@ static void update_callback(struct diff_queue_struct *q,
}
}
-static void update(int verbose, const char **files)
+static void update(int verbose, const char *prefix, const char **files)
{
struct rev_info rev;
- init_revisions(&rev, "");
+ init_revisions(&rev, prefix);
setup_revisions(0, NULL, &rev, NULL);
- rev.prune_data = get_pathspec(rev.prefix, files);
+ rev.prune_data = get_pathspec(prefix, files);
rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
rev.diffopt.format_callback = update_callback;
rev.diffopt.format_callback_data = &verbose;
@@ -209,7 +209,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
}
if (take_worktree_changes) {
- update(verbose, argv + i);
+ update(verbose, prefix, argv + i);
goto finish;
}