diff options
Diffstat (limited to 'builtin/update-index.c')
-rw-r--r-- | builtin/update-index.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c index c317981516..aaa6f78f16 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -11,6 +11,8 @@ #include "refs.h" #include "resolve-undo.h" #include "parse-options.h" +#include "pathspec.h" +#include "dir.h" /* * Default to not allowing changes to the list of files. The @@ -546,10 +548,11 @@ static int do_reupdate(int ac, const char **av, */ int pos; int has_head = 1; - const char **paths = get_pathspec(prefix, av + 1); struct pathspec pathspec; - init_pathspec(&pathspec, paths); + parse_pathspec(&pathspec, 0, + PATHSPEC_PREFER_CWD, + prefix, av + 1); if (read_ref("HEAD", head_sha1)) /* If there is no HEAD, that means it is an initial @@ -562,7 +565,7 @@ static int do_reupdate(int ac, const char **av, struct cache_entry *old = NULL; int save_nr; - if (ce_stage(ce) || !ce_path_match(ce, &pathspec)) + if (ce_stage(ce) || !ce_path_match(ce, &pathspec, NULL)) continue; if (has_head) old = read_one_ent(NULL, head_sha1, |