From d7b4f64d010a73a0e92a88eacff05b854cc81e97 Mon Sep 17 00:00:00 2001 From: Cyborus <87248184+Cyborus04@users.noreply.github.com> Date: Fri, 18 Aug 2023 17:22:30 -0400 Subject: [PATCH] missed a bit --- src/main.rs | 25 ------------------------- 1 file changed, 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 { .await? } -async fn get_remotes() -> eyre::Result> { - 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::>(); - Ok(remotes) -} - -async fn get_remote(remotes: &[(String, Url)]) -> eyre::Result { - 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) -} -