(git_mode: u32)
| 9516 | } |
| 9517 | |
| 9518 | fn 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 | |
| 9546 | fn git_mode_at(git_repo: &GitRepository, tree: &Tree<'_>, path: &str) -> Option<u32> { |
| 9547 | git_tree_entry(git_repo, tree, path) |
no test coverage detected