aboutsummaryrefslogtreecommitdiff
path: root/builtin/update-index.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 15:35:31 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 10:56:06 -0700
commit0fdc2ae5125b61e5cfe0cd49b064d8367994e61b (patch)
tree5b3b209423f7d5f19ca501ae5befe705547d2415 /builtin/update-index.c
parentfc12261fea778cabd08dec707169cb88ecdbc647 (diff)
downloadgit-0fdc2ae5125b61e5cfe0cd49b064d8367994e61b.tar.gz
git-0fdc2ae5125b61e5cfe0cd49b064d8367994e61b.tar.xz
convert some get_pathspec() calls to parse_pathspec()
These call sites follow the pattern: paths = get_pathspec(prefix, argv); init_pathspec(&pathspec, paths); which can be converted into a single parse_pathspec() call. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/update-index.c')
-rw-r--r--builtin/update-index.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c
index b9c2bd074..e79581879 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -547,10 +547,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