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