Ignore .git directories

This commit is contained in:
Max Brunsfeld
2021-04-26 15:46:06 -07:00
parent e7c594262f
commit 733dc15c32
2 changed files with 7 additions and 2 deletions
+5 -2
View File
@@ -1,6 +1,5 @@
use std::{path::Path, sync::Arc};
use ignore::gitignore::Gitignore;
use std::{ffi::OsStr, path::Path, sync::Arc};
pub enum IgnoreStack {
None,
@@ -37,6 +36,10 @@ impl IgnoreStack {
}
pub fn is_path_ignored(&self, path: &Path, is_dir: bool) -> bool {
if is_dir && path.file_name() == Some(OsStr::new(".git")) {
return true;
}
match self {
Self::None => false,
Self::All => true,