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

Function open_repository_readonly

atomic-cli/src/commands/mod.rs:395–402  ·  view source on GitHub ↗

Open a repository without migration, recovery, or table-initialization writes.

(path: Option<&Path>)

Source from the content-addressed store, hash-verified

393
394/// Open a repository without migration, recovery, or table-initialization writes.
395pub fn open_repository_readonly(path: Option<&Path>) -> CliResult<Repository> {
396 let repo_path = match path {
397 Some(path) if path.join(DOT_DIR).is_dir() => path.to_path_buf(),
398 Some(path) => find_repository_root_from(path)?,
399 None => find_repository_root()?,
400 };
401 Repository::open_readonly(&repo_path).map_err(CliError::from)
402}
403
404/// Acquire a read-only repository for a CLI query, allowing short-lived writers
405/// (such as Stop checkpoint publication) to finish first. Only typed database

Callers 1

Calls 3

find_repository_rootFunction · 0.85
is_dirMethod · 0.80

Tested by

no test coverage detected