summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyborus <87248184+Cyborus04@users.noreply.github.com>2023-08-18 23:22:30 +0200
committerCyborus <cyborus@noreply.localhost>2023-08-18 23:23:09 +0200
commitd7b4f64d010a73a0e92a88eacff05b854cc81e97 (patch)
treec970993ed4309ee7fc0f2e53a265e254bc04386f
parentMerge pull request 'move keys info to new file' (#7) from keys-file into main (diff)
downloadforgejo-cli-d7b4f64d010a73a0e92a88eacff05b854cc81e97.tar.xz
forgejo-cli-d7b4f64d010a73a0e92a88eacff05b854cc81e97.zip
missed a bit
-rw-r--r--src/main.rs25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/main.rs b/src/main.rs
index f43252a..7e881ee 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -256,28 +256,3 @@ async fn readline(msg: &str) -> eyre::Result<String> {
.await?
}
-async fn get_remotes() -> eyre::Result<Vec<(String, Url)>> {
- let repo = git2::Repository::open(".")?;
- let remotes = repo
- .remotes()?
- .iter()
- .filter_map(|name| {
- let name = name?.to_string();
- let url = Url::parse(repo.find_remote(&name).ok()?.url()?).ok()?;
- Some((name, url))
- })
- .collect::<Vec<_>>();
- Ok(remotes)
-}
-
-async fn get_remote(remotes: &[(String, Url)]) -> eyre::Result<Url> {
- let url = if remotes.len() == 1 {
- remotes[0].1.clone()
- } else if let Some((_, url)) = remotes.iter().find(|(name, _)| *name == "origin") {
- url.clone()
- } else {
- bail!("could not find remote");
- };
- Ok(url)
-}
-