summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorAntoine Pelisse <apelisse@gmail.com>2012-12-30 15:39:00 +0100
committerJunio C Hamano <gitster@pobox.com>2013-01-01 16:24:45 -0800
commit721ac4edde75723ef8dbbb68989bda89fbf6fc66 (patch)
tree55040c81db149276a3de41db6df15a66ca5f56c5 /wt-status.c
parent7e2010537e96d0a1144520222f20ba1dc3d61441 (diff)
downloadgit-721ac4edde75723ef8dbbb68989bda89fbf6fc66.tar.gz
dir.c: Make git-status --ignored more consistent
The current behavior of git-status is inconsistent and misleading. Especially when used with --untracked-files=all option: - files ignored in untracked directories will be missing from status output. - untracked files in committed yet ignored directories are also missing. - with --untracked-files=normal, untracked directories that contains only ignored files are dropped too. Make the behavior more consistent across all possible use cases: - "--ignored --untracked-files=normal" doesn't show each specific files but top directory. It instead shows untracked directories that only contains ignored files, and ignored tracked directories with untracked files. - "--ignored --untracked-files=all" shows all ignored files, either because it's in an ignored directory (tracked or untracked), or because the file is explicitly ignored. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/wt-status.c b/wt-status.c
index c110cbc125..3d477f4bd2 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -516,7 +516,9 @@ static void wt_status_collect_untracked(struct wt_status *s)
if (s->show_ignored_files) {
dir.nr = 0;
- dir.flags = DIR_SHOW_IGNORED | DIR_SHOW_OTHER_DIRECTORIES;
+ dir.flags = DIR_SHOW_IGNORED;
+ if (s->show_untracked_files != SHOW_ALL_UNTRACKED_FILES)
+ dir.flags |= DIR_SHOW_OTHER_DIRECTORIES;
fill_directory(&dir, s->pathspec);
for (i = 0; i < dir.nr; i++) {
struct dir_entry *ent = dir.entries[i];