Merge pull request #1396 from skoriop/default-ignore-git-folder

feat: ignore `.git/` by default
This commit is contained in:
Thayne McCombs 2023-10-20 22:35:22 -06:00 committed by GitHub
commit 3ed4ea7538
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,8 @@
# v8.7.1
- Breaking: `.git/` is now ignored by default when using `--hidden` / `-H`, use `--no-ignore` / `-I` or
`--no-ignore-vcs` to override, see #1387 and #1396 (@skoriop)
## Bugfixes
- `-1` properly conflicts with the exec family of options.

View File

@ -66,6 +66,13 @@ pub fn scan(paths: &[PathBuf], patterns: Arc<Vec<Regex>>, config: Arc<Config>) -
.add(pattern)
.map_err(|e| anyhow!("Malformed exclude pattern: {}", e))?;
}
if config.read_vcsignore {
override_builder
.add("!.git")
.expect("Invalid exclude pattern");
}
let overrides = override_builder
.build()
.map_err(|_| anyhow!("Mismatch in exclude patterns"))?;