diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs index 55d40e1416307622f71c244dc12e79884a76bbac..7436dc5437546d87ed4060c848b11b4af4c0e5ad 100644 --- a/crates/worktree/src/worktree.rs +++ b/crates/worktree/src/worktree.rs @@ -8,8 +8,7 @@ use clock::ReplicaId; use collections::{HashMap, HashSet, VecDeque}; use encoding_rs::Encoding; use fs::{ - Fs, MTime, PathEvent, PathEventKind, RemoveOptions, TrashedEntry, Watcher, copy_recursive, - read_dir_items, + Fs, MTime, PathEvent, RemoveOptions, TrashedEntry, Watcher, copy_recursive, read_dir_items, }; use futures::{ FutureExt as _, Stream, StreamExt, @@ -4302,24 +4301,11 @@ impl BackgroundScanner { } if let Some((dot_git_abs_path, path_in_git_dir)) = dot_git_paths { - // We ignore `""` as well, as that is going to be the - // `.git` folder itself. WE do not care about it, if - // there are changes within we will see them, we need - // this ignore to prevent us from accidentally observing - // the ignored created file due to the events not being - // empty after filtering. - - let is_dot_git_changed = { - path_in_git_dir == Path::new("") - && event.kind == Some(PathEventKind::Changed) - && self.fs.is_dir(abs_path.as_path()).await - }; let condition = skipped_files_in_dot_git.iter().any(|skipped| { OsStr::new(skipped) == path_in_git_dir.as_path().as_os_str() }) || skipped_dirs_in_dot_git .iter() - .any(|skipped_git_subdir| path_in_git_dir.starts_with(skipped_git_subdir)) - || is_dot_git_changed; + .any(|skipped_git_subdir| path_in_git_dir.starts_with(skipped_git_subdir)); if condition { log::debug!( "ignoring event {abs_path:?} as it's in the .git directory among skipped files or directories"