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

Method get_default_remote

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

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)

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Calls 3

load_remotesMethod · 0.80
get_defaultMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected