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

Function open_repository_with_vault

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

Open the repository at `root` for a command that writes to the vault, creating the vault when it does not exist yet. Vault *writes* — `goal start/stop/resume`, `materialize`, `sync`, `intent new/update/delete/link/attest`, `memory new/write/attest` — open through this helper so a repository created without a vault (`atomic init --no-vault`, or one that never ran `atomic vault init`) works on firs

(root: &Path)

Source from the content-addressed store, hash-verified

434/// path `atomic vault init` uses. It runs at most once: an existing vault is
435/// never re-initialized.
436pub fn open_repository_with_vault(root: &Path) -> CliResult<Repository> {
437 let repo = Repository::open(root).map_err(CliError::from)?;
438 ensure_vault_exists(&repo)?;
439 Ok(repo)
440}
441
442/// One-time implicit vault initialization, announced on stderr so `--json`
443/// output stays parseable.

Callers 11

runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85

Calls 2

ensure_vault_existsFunction · 0.85
openFunction · 0.50

Tested by 2

runMethod · 0.68
runMethod · 0.68