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

Function policy_root_for_capture

atomic-repository/src/repository/adoption.rs:326–337  ·  view source on GitHub ↗

The conversion policy content key for one capture boundary.

(root: &std::path::Path)

Source from the content-addressed store, hash-verified

324
325/// The conversion policy content key for one capture boundary.
326fn policy_root_for_capture(root: &std::path::Path) -> Result<String, RepositoryError> {
327 let policy =
328 super::conversion_policy_for_git(&git2::Repository::discover(root).map_err(|error| {
329 RepositoryError::InvalidRepository {
330 reason: format!("cannot open the Git repository for capture: {error}"),
331 }
332 })?)
333 .map_err(|error| RepositoryError::InvalidOperation {
334 message: format!("cannot compute conversion policy for capture: {error}"),
335 })?;
336 Ok(policy.root().content_key)
337}
338
339impl Repository {
340 /// Whether the working copy's private snapshot view holds an active

Callers 1

Calls 2

rootMethod · 0.45

Tested by

no test coverage detected