MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_remote

Method get_remote

atomic-repository/src/repository/remotes.rs:62–70  ·  view source on GitHub ↗

Get a remote by name. # Arguments `name` - The name of the remote to look up # Returns The remote entry if found, or an error if not found. # Example ```rust,ignore let repo = Repository::open(".")?; let origin = repo.get_remote("origin")?; println!("URL: {}", origin.url); ```

(&self, name: &str)

Source from the content-addressed store, hash-verified

60 /// println!("URL: {}", origin.url);
61 /// ```
62 pub fn get_remote(&self, name: &str) -> Result<RemoteEntry, RepositoryError> {
63 let config = self.load_remotes()?;
64 config
65 .get(name)
66 .cloned()
67 .ok_or_else(|| RepositoryError::RemoteNotFound {
68 name: name.to_string(),
69 })
70 }
71
72 /// Get the default remote.
73 ///

Callers

nothing calls this directly

Calls 2

load_remotesMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected