From: Junio C Hamano Date: Wed, 25 May 2005 01:20:08 +0000 (-0700) Subject: [PATCH] Allow dot files in ls-files as well (take #2). X-Git-Tag: v0.99~467 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=c4ee2952b3146fe7dc9433b92bf066e55987ef74;p=git.git [PATCH] Allow dot files in ls-files as well (take #2). This attempts to match "the directory '.git' anywhere in the tree is ignored" approach taken in update-cache. Signed-off-by: Junio C Hamano Signed-off-by: Linus Torvalds --- diff --git a/ls-files.c b/ls-files.c index 3b93d5e7..03b21826 100644 --- a/ls-files.c +++ b/ls-files.c @@ -136,7 +136,10 @@ static void read_directory(const char *path, const char *base, int baselen) 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;