This attempts to match "the directory '.git' anywhere in the
tree is ignored" approach taken in update-cache.
Signed-off-by: Junio C Hamano <redacted>
---
cd /opt/packrat/playpen/public/in-place/git/git.junio/
PATH=.:$PATH jit-diff : ls-files.c
# - linus: git-update-cache: allow dot-files
# + (working tree)
diff --git a/ls-files.c b/ls-files.c
--- a/ls-files.c
+++ b/ls-files.c
@@ -136,7 +136,10 @@ static void read_directory(const char *p
while ((de = readdir(dir)) != NULL) {
int len;
- if (de->d_name[0] == '.')
+ if ((de->d_name[0] == '.') &&
+ (de->d_name[1] == 0 ||
+ !strcmp(de->d_name + 1, ".") ||
+ !strcmp(de->d_name + 1, "git")))
continue;
if (excluded(de->d_name) != show_ignored)
continue;