diff --git a/crates/forge-forgejo/src/branch/get_all.rs b/crates/forge-forgejo/src/branch/get_all.rs deleted file mode 100644 index 46a9d271..00000000 --- a/crates/forge-forgejo/src/branch/get_all.rs +++ /dev/null @@ -1,45 +0,0 @@ -use git_next_config as config; -use git_next_git as git; - -use kxio::network::{self, Network}; - -pub async fn get_all( - repo_details: &git::RepoDetails, - net: &Network, -) -> git::branch::Result> { - let hostname = &repo_details.forge.hostname(); - let repo_path = &repo_details.repo_path; - use secrecy::ExposeSecret; - let token = repo_details.forge.token().expose_secret(); - let url = network::NetUrl::new(format!( - "https://{hostname}/api/v1/repos/{repo_path}/branches?token={token}" - )); - - let request = network::NetRequest::new( - network::RequestMethod::Get, - url, - network::NetRequestHeaders::new(), - network::RequestBody::None, - network::ResponseType::Json, - None, - network::NetRequestLogging::None, - ); - let response = net.get::>(request).await?; - let branches = response - .response_body() - .unwrap_or_default() - .into_iter() - .map(config::BranchName::from) - .collect::>(); - Ok(branches) -} - -#[derive(Debug, serde::Deserialize)] -struct Branch { - name: String, -} -impl From for config::BranchName { - fn from(value: Branch) -> Self { - Self::new(value.name) - } -} diff --git a/crates/forge-forgejo/src/branch/mod.rs b/crates/forge-forgejo/src/branch/mod.rs deleted file mode 100644 index c357a286..00000000 --- a/crates/forge-forgejo/src/branch/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod get_all; - -pub use get_all::get_all; diff --git a/crates/forge-forgejo/src/lib.rs b/crates/forge-forgejo/src/lib.rs index 692e5eb9..c80c7528 100644 --- a/crates/forge-forgejo/src/lib.rs +++ b/crates/forge-forgejo/src/lib.rs @@ -1,5 +1,3 @@ -pub mod branch; - use git_next_git as git; use kxio::network::{self, Network};