X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-ls-files.c;h=2c95ca61056f0c0b6ac0240605e2e4de895a6804;hb=cfe370c6476392095bc3f18013d195b1cccd6184;hp=3d59b0e140ca199997704ffcf59fbc2138345168;hpb=714cdcd03e2caac6e2dc8d94debc7c800742f546;p=git.git diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 3d59b0e14..2c95ca610 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -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) @@ -486,7 +481,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix) prefix_offset = strlen(prefix); git_config(git_default_config, NULL); - argc = parse_options(argc, argv, builtin_ls_files_options, + argc = parse_options(argc, argv, prefix, builtin_ls_files_options, ls_files_usage, 0); if (show_tag || show_valid_bit) { tag_cached = "H "; @@ -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 |