diff options
author | Karsten Blees <karsten.blees@gmail.com> | 2013-04-15 21:08:02 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-15 12:33:59 -0700 |
commit | 184d2a8e964d721c20775026308fcf63d57c0b4d (patch) | |
tree | 4f88e5c52142ceef9c44c4326bcc77beecf431e3 /dir.c | |
parent | 0104c9e7816e30701e4fdd9143889faacfa0eefa (diff) | |
download | git-184d2a8e964d721c20775026308fcf63d57c0b4d.tar.gz |
dir.c: git-ls-files --directories: don't hide empty directories
'git-ls-files --ignored --directories' hides empty directories even though
--no-empty-directory was not specified.
Treat the DIR_HIDE_EMPTY_DIRECTORIES flag independently from
DIR_SHOW_IGNORED to make all git-ls-files options work as expected.
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.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1120,15 +1120,13 @@ static enum directory_treatment treat_directory(struct dir_struct *dir, if ((dir->flags & DIR_SHOW_IGNORED) && !exclude) { int ignored; dir->flags &= ~DIR_SHOW_IGNORED; - dir->flags |= DIR_HIDE_EMPTY_DIRECTORIES; ignored = read_directory_recursive(dir, dirname, len, 1, simplify); - dir->flags &= ~DIR_HIDE_EMPTY_DIRECTORIES; dir->flags |= DIR_SHOW_IGNORED; return ignored ? ignore_directory : show_directory; } - if (!(dir->flags & DIR_SHOW_IGNORED) && - !(dir->flags & DIR_HIDE_EMPTY_DIRECTORIES)) + + if (!(dir->flags & DIR_HIDE_EMPTY_DIRECTORIES)) return show_directory; if (!read_directory_recursive(dir, dirname, len, 1, simplify)) return ignore_directory; |