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

Function manifest_gitlink_paths

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

R8: the manifest-authoritative gitlink set — every included entry whose kind is `InodeKind::Gitlink`, keyed by the same lossy path form the walker uses. The scanner never descends into these paths, whether the submodule owns a `.git` gitfile, an embedded `.git` directory, or no on-disk marker at all (uninitialized submodule).

(trees: &[&super::ProjectTree])

Source from the content-addressed store, hash-verified

3338/// submodule owns a `.git` gitfile, an embedded `.git` directory, or no
3339/// on-disk marker at all (uninitialized submodule).
3340fn manifest_gitlink_paths(trees: &[&super::ProjectTree]) -> std::collections::BTreeSet<String> {
3341 trees
3342 .iter()
3343 .flat_map(|tree| tree.manifest.entries.iter())
3344 .filter(|entry| entry.disposition == super::ManifestDisposition::Included)
3345 .filter(|entry| entry.kind == InodeKind::Gitlink)
3346 .map(|entry| String::from_utf8_lossy(entry.path.as_bytes()).into_owned())
3347 .collect()
3348}
3349
3350#[cfg(test)]
3351mod tests {

Callers 1

Calls 3

collectMethod · 0.45
iterMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected