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

Method new

atomic-cli/src/commands/git/parallel.rs:1475–1497  ·  view source on GitHub ↗
(policy: ConversionPolicy, current: Option<ProjectTree>)

Source from the content-addressed store, hash-verified

1473
1474impl ProspectiveProjectTree {
1475 fn new(policy: ConversionPolicy, current: Option<ProjectTree>) -> CliResult<Self> {
1476 let mut manifests = HashMap::new();
1477 let entries = if let Some(project) = current {
1478 let oid = Oid::from_bytes(project.git.root.as_bytes())
1479 .map_err(|error| git_error(format!("invalid projected Git tree: {error}")))?;
1480 let entries = project
1481 .manifest
1482 .entries
1483 .iter()
1484 .cloned()
1485 .map(|entry| (entry.path.clone(), entry))
1486 .collect();
1487 manifests.insert(oid, project);
1488 entries
1489 } else {
1490 BTreeMap::new()
1491 };
1492 Ok(Self {
1493 policy,
1494 entries,
1495 manifests,
1496 })
1497 }
1498
1499 fn apply_commit(
1500 &mut self,

Callers

nothing calls this directly

Calls 7

git_errorFunction · 0.70
as_bytesMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45
insertMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected