summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c53e7a)
raw | patch | inline | side by side (parent: 6c53e7a)
author | Junio C Hamano <gitster@pobox.com> | |
Fri, 7 Mar 2008 07:50:51 +0000 (23:50 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 7 Mar 2008 08:14:43 +0000 (00:14 -0800) |
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>
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>
builtin-ls-files.c | patch | blob | history |
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index 25dbfb44999566d0491b3f870a47f7df80aa7649..dc7eab89b34fed32dbb198a9aa9a7503fc162216 100644 (file)
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
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) {