hive-forge: global -r/--repo flag instead of per-verb [repo] positional (mara@#407)

This commit is contained in:
damocles 2026-05-25 02:12:04 +02:00 committed by Mara
commit badf21714b
21 changed files with 46 additions and 85 deletions

View file

@ -11,12 +11,10 @@ use crate::client::Client;
pub struct Args {
/// Branch name or commit SHA.
reference: String,
/// Repo override.
repo: Option<String>,
}
pub fn run(client: &Client, args: Args) -> Result<()> {
let repo = client.repo(args.repo.as_deref());
let repo = client.repo();
// Try branch first; the bash helper silently treats failure as
// "not a branch, use the reference as a commit sha directly".
let commit_sha = match client.get_json(&format!("/repos/{repo}/branches/{}", args.reference)) {