Skip to main content

remote_url

Function remote_url 

Source
pub fn remote_url(repo: &Repository, name: &str) -> Result<String, GitError>
Expand description

Read a remote’s URL out of the repository’s configuration.

Tries the fetch URL first and falls back to the push URL, matching git remote get-url semantics.

§Errors

Returns GitError::RemoteNotFound if the remote does not exist, GitError::RemoteHasNoUrl if it has neither a fetch nor a push URL, GitError::NonUtf8RemoteUrl if the URL bytes are not valid UTF-8, or GitError::FindRemote for other lookup failures.