summaryrefslogtreecommitdiff
path: root/builtin-ls-files.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-03-06 23:50:51 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-03-07 00:14:43 -0800
commit79418599e7221ef10641cf9cc07018c25b4d0310 (patch)
treec500528413e95b060ee2d6192d423af21ffe2627 /builtin-ls-files.c
parentRevert part of 1abf095 (git-add: adjust to the get_pathspec() changes) (diff)
downloadtgif-79418599e7221ef10641cf9cc07018c25b4d0310.tar.xz
Revert part of d089eba (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: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-ls-files.c')
-rw-r--r--builtin-ls-files.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index 25dbfb4499..dc7eab89b3 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -574,17 +574,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
pathspec = get_pathspec(prefix, argv + i);
/* Verify that the pathspec matches the prefix */
- if (pathspec) {
- if (argc != i) {
- int cnt;
- for (cnt = 0; pathspec[cnt]; cnt++)
- ;
- if (cnt != (argc - i))
- exit(1); /* error message already given */
- }
+ if (pathspec)
prefix = verify_pathspec(prefix);
- } else if (argc != i)
- exit(1); /* error message already given */
/* Treat unmatching pathspec elements as errors */
if (pathspec && error_unmatch) {