diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-07-14 15:35:31 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-15 10:56:06 -0700 |
commit | 0fdc2ae5125b61e5cfe0cd49b064d8367994e61b (patch) | |
tree | 5b3b209423f7d5f19ca501ae5befe705547d2415 /builtin/ls-tree.c | |
parent | fc12261fea778cabd08dec707169cb88ecdbc647 (diff) | |
download | git-0fdc2ae5125b61e5cfe0cd49b064d8367994e61b.tar.gz |
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/ls-tree.c')
-rw-r--r-- | builtin/ls-tree.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c index 93fc3a0e93..bdb03f3662 100644 --- a/builtin/ls-tree.c +++ b/builtin/ls-tree.c @@ -167,7 +167,15 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix) if (get_sha1(argv[0], sha1)) die("Not a valid object name %s", argv[0]); - init_pathspec(&pathspec, get_pathspec(prefix, argv + 1)); + /* + * show_recursive() rolls its own matching code and is + * generally ignorant of 'struct pathspec'. The magic mask + * cannot be lifted until it is converted to use + * match_pathspec_depth() or tree_entry_interesting() + */ + parse_pathspec(&pathspec, 0, + PATHSPEC_PREFER_CWD, + prefix, argv + 1); for (i = 0; i < pathspec.nr; i++) pathspec.items[i].nowildcard_len = pathspec.items[i].len; pathspec.has_wildcard = 0; |