diff options
author | Junio C Hamano <junkio@cox.net> | 2005-05-24 18:20:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-24 20:09:46 -0700 |
commit | c4ee2952b3146fe7dc9433b92bf066e55987ef74 (patch) | |
tree | 0a6dd114f3cbd19fc9773dc31f19c21b59007800 | |
parent | 6c56c5340a96aa2c80565813ee7f25a222a70cd9 (diff) | |
download | git-c4ee2952b3146fe7dc9433b92bf066e55987ef74.tar.gz |
[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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ls-files.c b/ls-files.c index 3b93d5e7cc..03b218260e 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; |