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

Function atomic_private_members

atomic-cli/src/commands/git/shim.rs:1688–1720  ·  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

1686/// selected, so an ephemeral view built from one commit's closure gains
1687/// only the private bookkeeping, never later content.
1688pub(super) fn atomic_private_members(
1689 repo: &Repository,
1690 view: &str,
1691) -> CliResult<Vec<atomic_core::types::Hash>> {
1692 let mut members = Vec::new();
1693 for (hash, origin) in repo
1694 .full_chain_member_origins(view)
1695 .map_err(CliError::from)?
1696 {
1697 if origin.is_some() {
1698 continue;
1699 }
1700 let change = repo.load_change(&hash).map_err(CliError::from)?;
1701 let mut paths: Vec<String> = change
1702 .file_ops()
1703 .iter()
1704 .map(|ops| ops.path().to_string())
1705 .collect();
1706 for hunk in change.hunks() {
1707 if let atomic_core::change::GraphOp::FileAdd { path, .. } = hunk {
1708 paths.push(path.clone());
1709 }
1710 }
1711 if !paths.is_empty()
1712 && paths
1713 .iter()
1714 .all(|path| atomic_repository::atomic_private_path(path.as_bytes()))
1715 {
1716 members.push(hash);
1717 }
1718 }
1719 Ok(members)
1720}
1721
1722/// Refuse to project `target` over a branch tip the view has never
1723/// 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