mirror of
https://github.com/git/git.git
synced 2024-12-04 07:24:41 +08: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:
parent
6c56c5340a
commit
c4ee2952b3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user