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

Function remove_path

atomic-repository/src/repository/snapshot_split.rs:932–942  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

930}
931
932fn remove_path(path: &Path) -> Result<(), SplitSnapshotError> {
933 let Ok(metadata) = std::fs::symlink_metadata(path) else {
934 return Ok(());
935 };
936 if metadata.file_type().is_dir() && !metadata.file_type().is_symlink() {
937 std::fs::remove_dir_all(path).map_err(RepositoryError::Io)?;
938 } else {
939 std::fs::remove_file(path).map_err(RepositoryError::Io)?;
940 }
941 Ok(())
942}
943
944#[cfg(unix)]
945fn create_symlink(path: &Path, bytes: &[u8]) -> Result<(), SplitSnapshotError> {

Callers 3

apply_index_manifestFunction · 0.85
write_repository_entryFunction · 0.85
replace_worktreeFunction · 0.85

Calls 1

is_dirMethod · 0.80

Tested by

no test coverage detected