GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — clibrowser/cligit/src/commands/remotes.rs at main · allthingssecurity/clibrowser

Expand file tree

/

remotes.rs

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
31 lines (28 loc) · 992 Bytes
/

remotes.rs

Copy path

File metadata and controls

31 lines (28 loc) · 992 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use anyhow::Result;
use crate::cli::RemotesArgs;
use crate::git_ctx::GitContext;
use crate::models::*;
use crate::output::OutputConfig;
pub fn execute(_args: RemotesArgs, ctx: &GitContext, out: &OutputConfig) -> Result<i32> {
let repo = &ctx.repo;
let remote_names = repo.remotes()?;
let mut remotes = Vec::new();
for name in remote_names.iter().flatten() {
if let Ok(remote) = repo.find_remote(name) {
remotes.push(RemoteInfo {
name: name.to_string(),
fetch_url: remote.url().map(String::from),
push_url: remote.pushurl().map(String::from).or_else(|| remote.url().map(String::from)),
});
}
}
let result = RemotesResult { count: remotes.len(), remotes };
if out.json {
out.print_json(&result);
} else {
for r in &result.remotes {
out.print_human(&format!("{}\t{}", r.name, r.fetch_url.as_deref().unwrap_or("")));
}
}
Ok(0)
}
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.