Watch
0
0
Fork
You've already forked hyperhive
0

hive-forge: dedup the --json refusal into refuse_json(), test it, cover attachment-get/artifact-get too

This commit is contained in:
damocles 2026-10-04 08:10:43 +02:00
commit e18497bb70
8 changed files with 58 additions and 27 deletions

View file

@ -1,9 +1,10 @@
//! `branches [pattern] [repo]` — list branches, optionally filtered.
use anyhow::{Result, bail};
use anyhow::Result;
use clap::Args as ClapArgs;
use crate::client::Client;
use crate::verbs::refuse_json;
#[derive(ClapArgs)]
pub struct Args {
@ -12,11 +13,7 @@ pub struct Args {
}
pub fn run(client: &Client, args: Args) -> Result<()> {
if client.json_mode() {
bail!(
"hive-forge branches: --json is not supported for this verb, only the plain name list"
);
}
refuse_json(client.json_mode(), "branches", "only the plain name list")?;
let (owner, name) = client.owner_repo()?;
let (_, branches) = client
.api()