From c4ee2952b3146fe7dc9433b92bf066e55987ef74 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 24 May 2005 18:20:08 -0700 Subject: [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 3b93d5e..03b2182 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; -- cgit v0.10.2-6-g49f6