Skip to content

Commit

Permalink
Revert part of d089eba (setup: sanitize absolute and funny paths in g…
Browse files Browse the repository at this point in the history
…et_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>
  • Loading branch information
Junio C Hamano committed Mar 7, 2008
1 parent 6c53e7a commit 7941859
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions builtin-ls-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7941859

Please sign in to comment.