Resolve the remote URL and any identity hint from the `--identity` flag. Returns `(url, identity_hint)` where `identity_hint` comes solely from the `--identity` CLI flag. If absent, `attach_identity` falls back to URL-subdomain inference.
(&self, repo: &Repository)
| 253 | /// the `--identity` CLI flag. If absent, `attach_identity` falls back to |
| 254 | /// URL-subdomain inference. |
| 255 | fn resolve_remote_url(&self, repo: &Repository) -> CliResult<(String, Option<String>)> { |
| 256 | // If it looks like a URL, use it directly |
| 257 | if self.remote.contains("://") { |
| 258 | return Ok((self.remote.clone(), self.identity.clone())); |
| 259 | } |
| 260 | |
| 261 | // Look up named remote in repository configuration |
| 262 | match repo.get_remote(&self.remote) { |
| 263 | Ok(entry) => Ok((entry.url, self.identity.clone())), |
| 264 | Err(atomic_repository::RepositoryError::RemoteNotFound { .. }) => { |
| 265 | Err(CliError::RemoteNotFound { |
| 266 | name: self.remote.clone(), |
| 267 | }) |
| 268 | } |
| 269 | Err(e) => Err(CliError::Repository(e)), |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | /// Get the local view name to pull into. |
| 274 | /// |
no test coverage detected