Re: [PATCH 3/5] wt-status: collect ignored files
- From
Jeff King <peff@peff.net>
- Date
- Apr 10, 2010, 07:48 UTC
- Message-ID
- <20100410074814.GB12567@coredump.intra.peff.net>
- In-Reply-To
- <1270885256-31589-4-git-send-email-gitster@pobox.com>
On Sat, Apr 10, 2010 at 12:40:54AM -0700, Junio C Hamano wrote:
Show 15 quoted lines
> + if (s->show_ignored_files) {
> + dir.nr = 0;
> + dir.flags = DIR_SHOW_IGNORED | DIR_SHOW_OTHER_DIRECTORIES;
> + fill_directory(&dir, s->pathspec);
> + for (i = 0; i < dir.nr; i++) {
> + struct dir_entry *ent = dir.entries[i];
> + if (!cache_name_is_other(ent->name, ent->len))
> + continue;
> + if (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))
> + continue;
> + string_list_insert(ent->name, &s->ignored);
> + free(ent);
> + }
> + }
> +Why not use DIR_COLLECT_IGNORED, which would mean we only have to traverse the directory tree once?
-Peff