MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / load_local_ignore

Function load_local_ignore

atomic-repository/src/ignore.rs:338–366  ·  view source on GitHub ↗

Load repository-local ignore rules from .atomicignore

(repo_root: &Path)

Source from the content-addressed store, hash-verified

336
337/// Load repository-local ignore rules from .atomicignore
338fn load_local_ignore(repo_root: &Path) -> Option<Gitignore> {
339 let ignore_path = repo_root.join(".atomicignore");
340
341 if ignore_path.exists() {
342 let mut builder = GitignoreBuilder::new(repo_root);
343 // builder.add() returns Option<Error> - log if there's an issue
344 if let Some(err) = builder.add(&ignore_path) {
345 log::warn!(
346 "Failed to parse .atomicignore at {}: {}",
347 ignore_path.display(),
348 err
349 );
350 return None;
351 }
352 match builder.build() {
353 Ok(gitignore) => Some(gitignore),
354 Err(err) => {
355 log::warn!(
356 "Failed to build ignore rules from {}: {}",
357 ignore_path.display(),
358 err
359 );
360 None
361 }
362 }
363 } else {
364 None
365 }
366}
367
368/// Get the path to the global ignore file.
369pub fn global_ignore_path() -> Option<std::path::PathBuf> {

Callers 2

loadMethod · 0.85
reloadMethod · 0.85

Calls 3

existsMethod · 0.45
addMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected