summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-25 01:20:08 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-25 03:09:46 (GMT)
commitc4ee2952b3146fe7dc9433b92bf066e55987ef74 (patch)
tree0a6dd114f3cbd19fc9773dc31f19c21b59007800
parent6c56c5340a96aa2c80565813ee7f25a222a70cd9 (diff)
downloadgit-c4ee2952b3146fe7dc9433b92bf066e55987ef74.zip
git-c4ee2952b3146fe7dc9433b92bf066e55987ef74.tar.gz
git-c4ee2952b3146fe7dc9433b92bf066e55987ef74.tar.bz2
[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 <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--ls-files.c5
1 files changed, 4 insertions, 1 deletions
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;