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

Function atomic_private_members

atomic-cli/src/commands/git/shim.rs:1644–1676  ·  view source on GitHub ↗

Members of `view` that no Git commit introduced and that touch only Atomic-private paths (`.atomic*`): the repository initialization change tracking `.atomicignore`. Native records of project files are never selected, so an ephemeral view built from one commit's closure gains only the private bookkeeping, never later content.

(
    repo: &Repository,
    view: &str,
)

Source from the content-addressed store, hash-verified

1642/// selected, so an ephemeral view built from one commit's closure gains
1643/// only the private bookkeeping, never later content.
1644pub(super) fn atomic_private_members(
1645 repo: &Repository,
1646 view: &str,
1647) -> CliResult<Vec<atomic_core::types::Hash>> {
1648 let mut members = Vec::new();
1649 for (hash, origin) in repo
1650 .full_chain_member_origins(view)
1651 .map_err(CliError::from)?
1652 {
1653 if origin.is_some() {
1654 continue;
1655 }
1656 let change = repo.load_change(&hash).map_err(CliError::from)?;
1657 let mut paths: Vec<String> = change
1658 .file_ops()
1659 .iter()
1660 .map(|ops| ops.path().to_string())
1661 .collect();
1662 for hunk in change.hunks() {
1663 if let atomic_core::change::GraphOp::FileAdd { path, .. } = hunk {
1664 paths.push(path.clone());
1665 }
1666 }
1667 if !paths.is_empty()
1668 && paths
1669 .iter()
1670 .all(|path| atomic_repository::atomic_private_path(path.as_bytes()))
1671 {
1672 members.push(hash);
1673 }
1674 }
1675 Ok(members)
1676}
1677
1678/// Refuse to project `target` over a branch tip the view has never
1679/// interpreted. `find_or_create_target_commit` appends a projection commit

Callers 2

view_log_up_toMethod · 0.85

Calls 13

atomic_private_pathFunction · 0.85
load_changeMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45
file_opsMethod · 0.45
pathMethod · 0.45
hunksMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45
is_emptyMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected