summaryrefslogtreecommitdiff
path: root/builtin-ls-files.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-20 16:13:16 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-20 16:13:16 -0800
commit9e7bd0110b41f9bb16377e322300629f8c4d6c12 (patch)
treedaf39390f7fcc9436ad3c8e9565ac9092f36ab9d /builtin-ls-files.c
parent23f12912d1b6c608a7418d242e257b7239861f61 (diff)
parent744dacd3f5045240a304e687f3ef7135398e7865 (diff)
downloadgit-9e7bd0110b41f9bb16377e322300629f8c4d6c12.tar.gz
Merge branch 'jc/setup'
* jc/setup: builtin-mv: minimum fix to avoid losing files git-add: adjust to the get_pathspec() changes. Make blame accept absolute paths setup: sanitize absolute and funny paths in get_pathspec()
Diffstat (limited to 'builtin-ls-files.c')
-rw-r--r--builtin-ls-files.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index dc7eab89b3..25dbfb4499 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -574,8 +574,17 @@ 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 (pathspec) {
+ if (argc != i) {
+ int cnt;
+ for (cnt = 0; pathspec[cnt]; cnt++)
+ ;
+ if (cnt != (argc - i))
+ exit(1); /* error message already given */
+ }
prefix = verify_pathspec(prefix);
+ } else if (argc != i)
+ exit(1); /* error message already given */
/* Treat unmatching pathspec elements as errors */
if (pathspec && error_unmatch) {