aboutsummaryrefslogtreecommitdiff
path: root/builtin/ls-tree.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/ls-tree.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/ls-tree.c')
-rw-r--r--builtin/ls-tree.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 93fc3a0e9..bdb03f366 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;