Resolve the target path for cloning. If `path` is provided, uses that. Otherwise, infers from the URL. # Arguments `url` - The remote URL `path` - Optional explicit path # Returns The resolved target path. # Example ```rust use atomic::commands::clone::helpers::resolve_target_path; // Explicit path takes precedence let path = resolve_target_path("https://example.com/repo", Some("my-repo".t
(url: &str, path: Option<String>)
| 193 | /// assert_eq!(path.to_str().unwrap(), "project"); |
| 194 | /// ``` |
| 195 | pub fn resolve_target_path(url: &str, path: Option<String>) -> PathBuf { |
| 196 | match path { |
| 197 | Some(p) => PathBuf::from(p), |
| 198 | None => { |
| 199 | let name = infer_repo_name(url).unwrap_or_else(|| "repo".to_string()); |
| 200 | PathBuf::from(name) |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | // Cleanup Guard |
| 206 |