Get the default remote. Returns the default remote (explicitly marked, or "origin" if it exists, or the only configured remote). # Returns A tuple of (name, entry) for the default remote. # Errors Returns an error if no remotes are configured.
(&self)
| 82 | /// |
| 83 | /// Returns an error if no remotes are configured. |
| 84 | pub fn get_default_remote(&self) -> Result<(String, RemoteEntry), RepositoryError> { |
| 85 | let config = self.load_remotes()?; |
| 86 | config |
| 87 | .get_default() |
| 88 | .map(|(name, entry)| (name.to_string(), entry.clone())) |
| 89 | .ok_or(RepositoryError::NoRemotesConfigured) |
| 90 | } |
| 91 | |
| 92 | /// Add a new remote. |
| 93 | /// |
nothing calls this directly
no test coverage detected