X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-ls-files.c;h=738215768ea701f0a35ed1e7bdc543779e6f4185;hb=73d66323ac78c750ba42fef23b1cb8fd2110e023;hp=2e47242b9d28077fa256170365c69f84493d3707;hpb=8740773ee5ef450cefd03d3576f348fe65e92edf;p=git.git diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 2e47242b9..738215768 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -172,8 +172,8 @@ static void show_files(struct dir_struct *dir, const char *prefix) for (i = 0; i < active_nr; i++) { struct cache_entry *ce = active_cache[i]; int dtype = ce_to_dtype(ce); - if (excluded(dir, ce->name, &dtype) != - !!(dir->flags & DIR_SHOW_IGNORED)) + if (dir->flags & DIR_SHOW_IGNORED && + !excluded(dir, ce->name, &dtype)) continue; if (show_unmerged && !ce_stage(ce)) continue; @@ -189,8 +189,8 @@ static void show_files(struct dir_struct *dir, const char *prefix) struct stat st; int err; int dtype = ce_to_dtype(ce); - if (excluded(dir, ce->name, &dtype) != - !!(dir->flags & DIR_SHOW_IGNORED)) + if (dir->flags & DIR_SHOW_IGNORED && + !excluded(dir, ce->name, &dtype)) continue; if (ce->ce_flags & CE_UPDATE) continue; @@ -531,11 +531,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 |