提交 79418599 编写于 作者: J Junio C Hamano

Revert part of d089ebaa (setup: sanitize absolute and funny paths in get_pathspec())

When get_pathspec() was originally made absolute-path capable,
we botched the interface to it, without dying inside the function
when given a path that is outside the work tree, and made it the
responsibility of callers to check the condition in a roundabout
way.  This is made unnecessary with the previous patch.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 6c53e7ac
...@@ -574,17 +574,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix) ...@@ -574,17 +574,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
pathspec = get_pathspec(prefix, argv + i); pathspec = get_pathspec(prefix, argv + i);
/* Verify that the pathspec matches the prefix */ /* Verify that the pathspec matches the prefix */
if (pathspec) { if (pathspec)
if (argc != i) {
int cnt;
for (cnt = 0; pathspec[cnt]; cnt++)
;
if (cnt != (argc - i))
exit(1); /* error message already given */
}
prefix = verify_pathspec(prefix); prefix = verify_pathspec(prefix);
} else if (argc != i)
exit(1); /* error message already given */
/* Treat unmatching pathspec elements as errors */ /* Treat unmatching pathspec elements as errors */
if (pathspec && error_unmatch) { if (pathspec && error_unmatch) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册