]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-ls-files.c
MSVC: Add support for building with NO_MMAP
[thirdparty/git.git] / builtin-ls-files.c
index 2312866605c4140ac4e5a9f5bb963ca5ab5c6da3..2c95ca61056f0c0b6ac0240605e2e4de895a6804 100644 (file)
@@ -161,12 +161,7 @@ static void show_files(struct dir_struct *dir, const char *prefix)
 
        /* For cached/deleted files we don't need to even do the readdir */
        if (show_others || show_killed) {
-               const char *path = ".", *base = "";
-               int baselen = prefix_len;
-
-               if (baselen)
-                       path = base = prefix;
-               read_directory(dir, path, base, baselen, pathspec);
+               fill_directory(dir, pathspec);
                if (show_others)
                        show_other_files(dir);
                if (show_killed)
@@ -529,11 +524,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
                ps_matched = xcalloc(1, num);
        }
 
-       if ((dir.flags & DIR_SHOW_IGNORED) && !exc_given) {
-               fprintf(stderr, "%s: --ignored needs some exclude pattern\n",
-                       argv[0]);
-               exit(1);
-       }
+       if ((dir.flags & DIR_SHOW_IGNORED) && !exc_given)
+               die("ls-files --ignored needs some exclude pattern");
 
        /* With no flags, we default to showing the cached files */
        if (!(show_stage | show_deleted | show_others | show_unmerged |