hive-forge: defer repo resolution to the accessor, not construction

This commit is contained in:
damocles 2026-09-02 15:18:56 +02:00 committed by mara
commit fe7bf81d4a
14 changed files with 57 additions and 35 deletions

View file

@ -36,7 +36,7 @@ pub struct Args {
/// not-ready verdict is NOT an error — it's reported and reflected in
/// the process exit code instead.
pub fn run(client: &Client, args: Args) -> Result<()> {
let repo = client.repo();
let repo = client.repo()?;
match (args.pr, args.sha) {
(Some(pr), _) => pr_status(client, repo, pr),
(None, Some(sha)) => sha_status(client, &sha),
@ -192,7 +192,7 @@ pub(crate) fn fetch_combined_in(client: &Client, repo: &str, sha: &str) -> Resul
/// Statuses ride as their API-shape JSON so the render helpers stay
/// pure `Value` walkers.
fn fetch_combined(client: &Client, sha: &str) -> Result<(String, Vec<Value>)> {
let combined = fetch_combined_in(client, client.repo(), sha)?;
let combined = fetch_combined_in(client, client.repo()?, sha)?;
Ok((combined.state, combined.statuses))
}