# [PATCH] list_untracked_files: remove empty squashed directories

1 messages from 2006-06-09 to 2006-06-09. Participants: Jeff King.
Thread: https://gitlist.dev/t/4443

## Jeff King, 2006-06-09 05:41

Subject: [PATCH] list_untracked_files: remove empty squashed directories
Message-ID: <20060609054134.GA16026@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20060609054134.GA16026%40coredump.intra.peff.net

```
Signed-off-by: Jeff King <peff@peff.net>
---
This patch is for cogito.

Ordinarily, I would say if you have empty directories, you should remove
them. However, if you have a directory in which all files are excluded,
it will still appear in cg-status -w (even though cg-status -S is
empty!).

This, of course, means that actual empty directories will also be
ignored; there's no way around it without putting logic into
git-ls-files to distinguish between the two.

 cg-Xlib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cg-Xlib b/cg-Xlib
index 839e9f8..3ec32b7 100755
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -443,7 +443,7 @@ list_untracked_files()
 		fi
 	fi
 	local listdirs=
-	[ "$squashflag" != "squashdirs" ] || listdirs=--directory
+	[ "$squashflag" != "squashdirs" ] || listdirs="--directory --no-empty-directory"
 	git-ls-files -z --others $listdirs "${EXCLUDE[@]}"
 }
 
-- 
1.4.0.rc2

```
