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>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2013-07-14 15:35:31 +07:00
committed by Junio C Hamano
parent fc12261fea
commit 0fdc2ae512
4 changed files with 17 additions and 8 deletions

View File

@ -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