parse_pathspec: accept :(icase)path syntax
[gitweb.git] / builtin / ls-files.c
index 50e6edf07e9d706ed5208ced7d0740ab2310b84e..d3a0495f7d485134176c41e302b5a644a824dcfd 100644 (file)
@@ -216,7 +216,7 @@ static void show_files(struct dir_struct *dir)
 
        /* For cached/deleted files we don't need to even do the readdir */
        if (show_others || show_killed) {
-               fill_directory(dir, pathspec.raw);
+               fill_directory(dir, &pathspec);
                if (show_others)
                        show_other_files(dir);
                if (show_killed)
@@ -315,13 +315,12 @@ void overlay_tree_on_cache(const char *tree_name, const char *prefix)
        }
 
        if (prefix) {
-               static const char *(matchbuf[2]);
-               matchbuf[0] = prefix;
-               matchbuf[1] = NULL;
-               init_pathspec(&pathspec, matchbuf);
-               pathspec.items[0].nowildcard_len = pathspec.items[0].len;
+               static const char *(matchbuf[1]);
+               matchbuf[0] = NULL;
+               parse_pathspec(&pathspec, PATHSPEC_ALL_MAGIC,
+                              PATHSPEC_PREFER_CWD, prefix, matchbuf);
        } else
-               init_pathspec(&pathspec, NULL);
+               memset(&pathspec, 0, sizeof(pathspec));
        if (read_tree(tree, 1, &pathspec))
                die("unable to read tree entries %s", tree_name);
 
@@ -546,7 +545,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
                       prefix, argv);
 
        /* Find common prefix for all pathspec's */
-       max_prefix = common_prefix(pathspec.raw);
+       max_prefix = common_prefix(&pathspec);
        max_prefix_len = max_prefix ? strlen(max_prefix) : 0;
 
        /* Treat unmatching pathspec elements as errors */