ignore: correctly detect hidden files on Windows

This commit fixes a bug where ripgrep only treated files beginning with
a `.` as hidden. On Windows, we continue this tradition, but
additionally check whether a file has the special Windows "hidden"
attribute set. If so, we treat it as a hidden file.

In order to make this work without an additional stat call, we had to
rearrange some of the plumbing from the directory traverser.

Fixes #1154
This commit is contained in:
Andrew Gallant
2019-01-27 10:45:09 -05:00
parent 5724391d39
commit f158a42a71
5 changed files with 83 additions and 41 deletions

View File

@@ -29,7 +29,7 @@ thread_local = "0.3.6"
walkdir = "2.2.7"
[target.'cfg(windows)'.dependencies.winapi-util]
version = "0.1.1"
version = "0.1.2"
[dev-dependencies]
tempfile = "3.0.5"