chore(dep): update forgejo-api to 0.7.0

This commit is contained in:
Cyborus 2025-02-27 16:09:56 -05:00
parent 4605ea073c
commit 41546bfb2d
No known key found for this signature in database
4 changed files with 7 additions and 5 deletions

4
Cargo.lock generated
View file

@ -583,9 +583,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "forgejo-api"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c00495eb9a5b9f13d25260a848dfd3f86949a2078aaa8120b7f2c31433319910"
checksum = "e2cb702a4015d636ef784634ece1565e791618a76e0ef8a582a7f9c4b86927d1"
dependencies = [
"base64ct",
"bytes",

View file

@ -27,7 +27,7 @@ comrak = "0.26.0"
crossterm = "0.27.0"
directories = "5.0.1"
eyre = "0.6.12"
forgejo-api = "0.6.0"
forgejo-api = "0.7.0"
futures = "0.3.30"
git2 = "0.19.0"
hyper = "1.4.1"

View file

@ -394,7 +394,7 @@ async fn view_issues(
.issue_list_issues(repo.owner(), repo.name(), query.clone())
.await?;
issues.extend(page);
if !headers.x_has_more.unwrap_or_default() {
if issues.len() < headers.x_total_count.unwrap_or_default() as usize {
break;
}
}

View file

@ -1699,6 +1699,7 @@ async fn find_pr_from_branch(
api: &Forgejo,
head: &str,
) -> eyre::Result<Option<forgejo_api::structs::PullRequest>> {
let mut seen = 0;
for page in 1.. {
let branch_query = forgejo_api::structs::RepoListBranchesQuery {
page: Some(page),
@ -1713,12 +1714,13 @@ async fn find_pr_from_branch(
.map(|branch| check_branch_pair(repo_owner, repo_name, api, branch, head)),
)
.await?;
seen += prs.len();
for pr in prs {
if pr.is_some() {
return Ok(pr);
}
}
if !headers.x_has_more.unwrap_or_default() {
if seen < headers.x_total_count.unwrap_or_default() as usize {
break;
}
}