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

Function record_imported_vault_policy

atomic-cli/src/commands/git/parallel.rs:1710–1720  ·  view source on GitHub ↗

Record the vault projection policy (RFC §6.2) for a freshly imported repository. `tracked` is the policy resolved BEFORE the repository (and its default configuration) was created — the same unambiguous HEAD-tree detection the import plan above just used. `git import` is the first command that needs the decision, so it persists the detected value once, here, and every later command reconstructs t

(repo: &Repository, tracked: bool)

Source from the content-addressed store, hash-verified

1708/// every later command reconstructs this exact conversion policy from the
1709/// record instead of re-detecting against a moving HEAD.
1710pub(crate) fn record_imported_vault_policy(repo: &Repository, tracked: bool) -> CliResult<()> {
1711 if tracked {
1712 repo.set_shim_vault_policy(atomic_config::ShimVaultPolicy::Tracked, None)
1713 .map_err(CliError::from)?;
1714 print_info(
1715 "Git tracks .vault/: recorded shim vault policy 'tracked' — the vault joins \
1716 the manifest projection exactly like any other tracked path.",
1717 );
1718 }
1719 Ok(())
1720}
1721
1722pub(crate) fn git_object_id(algorithm: GitHashAlgorithm, oid: Oid) -> CliResult<GitObjectId> {
1723 GitObjectId::new(algorithm, oid.as_bytes().to_vec()).map_err(|error| {

Callers 1

run_importMethod · 0.85

Calls 2

print_infoFunction · 0.85
set_shim_vault_policyMethod · 0.80

Tested by

no test coverage detected