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

Method canonical_dot_dir

atomic-repository/src/repository/mod.rs:538–543  ·  view source on GitHub ↗

Resolve the **canonical** `.atomic` directory for a working path without* opening the database. If `path` is inside an agent sandbox, follows the `.atomic-sandbox` pointer to the canonical repository; otherwise finds the enclosing repository root. Returns ` /.atomic`. Use this for lock-free filesystem access to the canonical graph — e.g. writing a provenance graph through [`Change

(path: P)

Source from the content-addressed store, hash-verified

536 /// sandbox `path/.atomic` is a throwaway local dir (or absent), so joining
537 /// `.atomic` onto the working root would miss the real graph entirely.
538 pub fn canonical_dot_dir<P: AsRef<Path>>(path: P) -> Result<PathBuf, RepositoryError> {
539 if let Some((_working, canonical, _view)) = sandbox::detect_sandbox(path.as_ref()) {
540 return Ok(Self::find_root(&canonical)?.join(DOT_DIR));
541 }
542 Ok(Self::find_root(path.as_ref())?.join(DOT_DIR))
543 }
544
545 /// Get the repository root path.
546 #[inline]

Callers

nothing calls this directly

Calls 2

detect_sandboxFunction · 0.85
as_refMethod · 0.80

Tested by

no test coverage detected