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

Function expected_materialization

atomic-cli/src/commands/git/parallel.rs:9518–9544  ·  view source on GitHub ↗
(git_mode: u32)

Source from the content-addressed store, hash-verified

9516}
9517
9518fn expected_materialization(git_mode: u32) -> CliResult<ExpectedMaterialization> {
9519 let expected = match git_mode {
9520 0o100644 => ExpectedMaterialization {
9521 kind: atomic_core::change::InodeKind::Regular,
9522 mode: 0o644,
9523 },
9524 0o100755 => ExpectedMaterialization {
9525 kind: atomic_core::change::InodeKind::Regular,
9526 mode: 0o755,
9527 },
9528 0o120000 => ExpectedMaterialization {
9529 kind: atomic_core::change::InodeKind::Symlink,
9530 mode: 0o777,
9531 },
9532 0o160000 => ExpectedMaterialization {
9533 kind: atomic_core::change::InodeKind::Gitlink,
9534 mode: 0o644,
9535 },
9536 mode => {
9537 return Err(git_error(format!(
9538 "unsupported Git file mode {mode:#o}; refusing to synthesize \
9539 attributes that cannot project this representation"
9540 )))
9541 }
9542 };
9543 Ok(expected)
9544}
9545
9546fn git_mode_at(git_repo: &GitRepository, tree: &Tree<'_>, path: &str) -> Option<u32> {
9547 git_tree_entry(git_repo, tree, path)

Callers 3

compileMethod · 0.85

Calls 1

git_errorFunction · 0.70

Tested by

no test coverage detected