From: Junio C Hamano Date: Wed, 25 May 2005 01:20:08 GMT Subject: [PATCH] Allow dot files in ls-files as well (take #2). Message-ID: <7vwtpoqeyf.fsf_-_@assigned-by-dhcp.cox.net> In-Reply-To: This attempts to match "the directory '.git' anywhere in the tree is ignored" approach taken in update-cache. Signed-off-by: Junio C Hamano --- 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;