(path: &str)
| 370 | const HIDDEN_DIR_WHITELIST: &[&str] = &[".vault", ".atomicignore"]; |
| 371 | |
| 372 | pub(crate) fn should_ignore_untracked(path: &str) -> bool { |
| 373 | for component in std::path::Path::new(path).components() { |
| 374 | if let std::path::Component::Normal(name) = component { |
| 375 | let name_str = name.to_string_lossy(); |
| 376 | if AUTO_ADD_IGNORE_DIRS.contains(&name_str.as_ref()) { |
| 377 | return true; |
| 378 | } |
| 379 | // Skip hidden directories (starting with .) unless whitelisted |
| 380 | if name_str.starts_with('.') |
| 381 | && name_str.len() > 1 |
| 382 | && !HIDDEN_DIR_WHITELIST.contains(&name_str.as_ref()) |
| 383 | { |
| 384 | return true; |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | false |
| 389 | } |
no test coverage detected