summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-04-10 00:11:53 -0700
committerJunio C Hamano <gitster@pobox.com>2010-04-10 00:43:59 -0700
commit6cb3f6b28294cb2b3766370f42a570fb46ba4e97 (patch)
tree7864d62a23bbc92fb1727745191c712bd097f1e3 /wt-status.c
parentf5b26b1d14d3362fa41e51f4f78cdf56968733ba (diff)
downloadgit-6cb3f6b28294cb2b3766370f42a570fb46ba4e97.tar.gz
wt-status: collect ignored files
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/wt-status.c b/wt-status.c
index c88159ad06..f13c7da64f 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -42,6 +42,7 @@ void wt_status_prepare(struct wt_status *s)
s->index_file = get_index_file();
s->change.strdup_strings = 1;
s->untracked.strdup_strings = 1;
+ s->ignored.strdup_strings = 1;
}
static void wt_status_print_unmerged_header(struct wt_status *s)
@@ -382,6 +383,21 @@ static void wt_status_collect_untracked(struct wt_status *s)
free(ent);
}
+ 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);
+ }
+ }
+
free(dir.entries);
}