fix: remove old implementation of forgejo get all branches
All checks were successful
Rust / build (push) Successful in 1m10s
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
ci/woodpecker/cron/cron-docker-builder Pipeline was successful
ci/woodpecker/cron/push-next Pipeline was successful
ci/woodpecker/cron/tag-created Pipeline was successful
All checks were successful
Rust / build (push) Successful in 1m10s
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
ci/woodpecker/cron/cron-docker-builder Pipeline was successful
ci/woodpecker/cron/push-next Pipeline was successful
ci/woodpecker/cron/tag-created Pipeline was successful
This commit is contained in:
parent
012668dd0a
commit
9f04b1ae6c
3 changed files with 0 additions and 50 deletions
|
@ -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<Vec<config::BranchName>> {
|
||||
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::<Vec<Branch>>(request).await?;
|
||||
let branches = response
|
||||
.response_body()
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(config::BranchName::from)
|
||||
.collect::<Vec<_>>();
|
||||
Ok(branches)
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
struct Branch {
|
||||
name: String,
|
||||
}
|
||||
impl From<Branch> for config::BranchName {
|
||||
fn from(value: Branch) -> Self {
|
||||
Self::new(value.name)
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
mod get_all;
|
||||
|
||||
pub use get_all::get_all;
|
|
@ -1,5 +1,3 @@
|
|||
pub mod branch;
|
||||
|
||||
use git_next_git as git;
|
||||
|
||||
use kxio::network::{self, Network};
|
||||
|
|
Loading…
Reference in a new issue