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)
| 219 | /// the `--identity` CLI flag. If absent, `attach_identity` falls back to |
| 220 | /// URL-subdomain inference. |
| 221 | fn resolve_remote_url(&self, repo: &Repository) -> CliResult<(String, Option<String>)> { |
| 222 | // If it looks like a URL, use it directly |
| 223 | if self.remote.contains("://") { |
| 224 | return Ok((self.remote.clone(), self.identity.clone())); |
| 225 | } |
| 226 | |
| 227 | // Look up named remote in repository configuration |
| 228 | match repo.get_remote(&self.remote) { |
| 229 | Ok(entry) => Ok((entry.url, self.identity.clone())), |
| 230 | Err(atomic_repository::RepositoryError::RemoteNotFound { .. }) => { |
| 231 | Err(CliError::RemoteNotFound { |
| 232 | name: self.remote.clone(), |
| 233 | }) |
| 234 | } |
| 235 | Err(e) => Err(CliError::Repository(e)), |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | /// Get the local view name to push from. |
| 240 | /// |
no test coverage detected