hive-forge: defer repo resolution to the accessor, not construction
This commit is contained in:
parent
cc2503d9c7
commit
fe7bf81d4a
14 changed files with 57 additions and 35 deletions
|
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue