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