Skip to content

Commit 7941859

Browse files
committed
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>
1 parent 6c53e7a commit 7941859

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

builtin-ls-files.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -574,17 +574,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
574574
pathspec = get_pathspec(prefix, argv + i);
575575

576576
/* Verify that the pathspec matches the prefix */
577-
if (pathspec) {
578-
if (argc != i) {
579-
int cnt;
580-
for (cnt = 0; pathspec[cnt]; cnt++)
581-
;
582-
if (cnt != (argc - i))
583-
exit(1); /* error message already given */
584-
}
577+
if (pathspec)
585578
prefix = verify_pathspec(prefix);
586-
} else if (argc != i)
587-
exit(1); /* error message already given */
588579

589580
/* Treat unmatching pathspec elements as errors */
590581
if (pathspec && error_unmatch) {

0 commit comments

Comments
 (0)