(root: &DataRoot, repo_id: RepoId)
| 52 | } |
| 53 | |
| 54 | pub fn delete(root: &DataRoot, repo_id: RepoId) -> Result<()> { |
| 55 | let path = root.repo_path(repo_id); |
| 56 | log::warn!("deleting repo {} at {:?}", repo_id, path); |
| 57 | |
| 58 | match std::fs::remove_dir_all(&path) { |
| 59 | Ok(()) => log::warn!("deleted {:?}", path), |
| 60 | Err(err) => log::warn!("failed to delete {:?}: {}", path, err), |
| 61 | } |
| 62 | |
| 63 | Ok(()) |
| 64 | } |
| 65 | |
| 66 | // https://github.com/rust-lang/git2-rs/blob/master/examples/init.rs#L94 |
| 67 | fn init(path: &PathBuf) -> Result<Self> { |