1
0
mirror of https://github.com/git/git synced 2024-07-07 19:39:27 +00:00

[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>
This commit is contained in:
Junio C Hamano 2005-05-24 18:20:08 -07:00 committed by Linus Torvalds
parent 6c56c5340a
commit c4ee2952b3

View File

@ -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;