@matheusbsbs / matheus-bagliano / commits / 79418599e7
Fork 0

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>

Junio C Hamano committed Mar 6, 2008 at 23:50 UTC 79418599e7221ef10641cf9cc07018c25b4d0310
1 file changed +1 -10
builtin-ls-files.c
+1 -10
@@ -574,17 +574,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
574 pathspec = get_pathspec(prefix, argv + i);
575
576 /* 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)
578 prefix = verify_pathspec(prefix);
586 - } else if (argc != i)
587 - exit(1); /* error message already given */
579
580 /* Treat unmatching pathspec elements as errors */
581 if (pathspec && error_unmatch) {