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

Method list_remotes

atomic-cli/src/commands/remote/mod.rs:161–182  ·  view source on GitHub ↗

List all configured remotes.

(&self)

Source from the content-addressed store, hash-verified

159
160 /// List all configured remotes.
161 fn list_remotes(&self) -> CliResult<()> {
162 let repo_root = find_repository_root()?;
163 let repo = Repository::open(&repo_root).map_err(CliError::Repository)?;
164
165 let remotes = repo.list_remotes().map_err(CliError::Repository)?;
166
167 if remotes.is_empty() {
168 print_hint("No remotes configured. Use 'atomic remote add <name> <url>' to add one.");
169 return Ok(());
170 }
171
172 for (name, entry) in &remotes {
173 if self.verbose {
174 let default_marker = if entry.default { " (default)" } else { "" };
175 println!("{}\t{}{}", name, entry.url, default_marker);
176 } else {
177 println!("{}", name);
178 }
179 }
180
181 Ok(())
182 }
183
184 /// Add a new remote.
185 fn add_remote(&self, add: &RemoteAdd) -> CliResult<()> {

Callers 1

runMethod · 0.45

Calls 3

find_repository_rootFunction · 0.85
print_hintFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected