From c4ee2952b3146fe7dc9433b92bf066e55987ef74 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 24 May 2005 18:20:08 -0700 Subject: [PATCH] [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 --- ls-files.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ls-files.c b/ls-files.c index 3b93d5e7c..03b218260 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; -- 2.26.2