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

Method move_file_on_disk

atomic-cli/src/commands/mv.rs:171–181  ·  view source on GitHub ↗

Move the actual file on disk.

(&self, repo_root: &Path, from: &str, to: &str)

Source from the content-addressed store, hash-verified

169
170 /// Move the actual file on disk.
171 fn move_file_on_disk(&self, repo_root: &Path, from: &str, to: &str) -> std::io::Result<()> {
172 let from_path = repo_root.join(from);
173 let to_path = repo_root.join(to);
174
175 // Create parent directories if needed
176 if let Some(parent) = to_path.parent() {
177 std::fs::create_dir_all(parent)?;
178 }
179
180 std::fs::rename(&from_path, &to_path)
181 }
182
183 fn restore_after_staging_failure(
184 source: &Path,

Callers 1

runMethod · 0.80

Calls 1

parentMethod · 0.80

Tested by

no test coverage detected