aboutsummaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorKarsten Blees <karsten.blees@gmail.com>2013-04-15 21:08:42 +0200
committerJunio C Hamano <gitster@pobox.com>2013-04-15 12:33:59 -0700
commitc94ab010266776c85b588473260ed048d1e654ff (patch)
treebd0d87822819fee6670fe77394b1fa26ef18a144 /dir.c
parent184d2a8e964d721c20775026308fcf63d57c0b4d (diff)
downloadgit-c94ab010266776c85b588473260ed048d1e654ff.tar.gz
git-c94ab010266776c85b588473260ed048d1e654ff.tar.xz
dir.c: git-status --ignored: don't list empty directories as ignored
'git-status --ignored' lists empty untracked directories as ignored, even though they don't have any ignored files. When checking if a directory is already listed as untracked (i.e. shouldn't be listed as ignored as well), don't assume that the directory has only ignored files if it doesn't have untracked files, as the directory may be empty. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 15d7277a0..fecb6da0a 100644
--- a/dir.c
+++ b/dir.c
@@ -1115,7 +1115,7 @@ static enum directory_treatment treat_directory(struct dir_struct *dir,
/*
* We are looking for ignored files and our directory is not ignored,
- * check if it contains only ignored files
+ * check if it contains untracked files (i.e. is listed as untracked)
*/
if ((dir->flags & DIR_SHOW_IGNORED) && !exclude) {
int ignored;
@@ -1123,7 +1123,8 @@ static enum directory_treatment treat_directory(struct dir_struct *dir,
ignored = read_directory_recursive(dir, dirname, len, 1, simplify);
dir->flags |= DIR_SHOW_IGNORED;
- return ignored ? ignore_directory : show_directory;
+ if (ignored)
+ return ignore_directory;
}
if (!(dir->flags & DIR_HIDE_EMPTY_DIRECTORIES))