diff options
Diffstat (limited to 'builtin/ls-files.c')
-rw-r--r-- | builtin/ls-files.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 844c7f4e0e..45cc3b23dd 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -752,6 +752,9 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix) if (pathspec.nr && error_unmatch) ps_matched = xcalloc(pathspec.nr, 1); + if ((dir.flags & DIR_SHOW_IGNORED) && !show_others && !show_cached) + die("ls-files -i must be used with either -o or -c"); + if ((dir.flags & DIR_SHOW_IGNORED) && !exc_given) die("ls-files --ignored needs some exclude pattern"); |