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

Function open_repository_readonly

atomic-cli/src/commands/mod.rs:397–404  ·  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

395
396/// Open a repository without migration, recovery, or table-initialization writes.
397pub fn open_repository_readonly(path: Option<&Path>) -> CliResult<Repository> {
398 let repo_path = match path {
399 Some(path) if path.join(DOT_DIR).is_dir() => path.to_path_buf(),
400 Some(path) => find_repository_root_from(path)?,
401 None => find_repository_root()?,
402 };
403 Repository::open_readonly(&repo_path).map_err(CliError::from)
404}
405
406/// Acquire a read-only repository for a CLI query, allowing short-lived writers
407/// (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