Watch
0
0
Fork
You've already forked hyperhive
0

hive-forge: pr edit --base retargets a PR

Forgejo's issue edit endpoint (/issues/<n>) has no base field, so `pr edit`
could not retarget a stacked PR once its base merged. `--base <BRANCH>`
(non-empty) switches the edit onto PATCH /pulls/<n>, which carries `base`
alongside title/body/state/milestone. Without `--base`, `pr edit` is
unchanged and still goes through the issue endpoint.
This commit is contained in:
atlas 2026-10-13 03:37:49 +02:00 • committed by mara
commit 9e3a00825b
7 changed files with 348 additions and 27 deletions

View file

@ -39,9 +39,9 @@ enum Cmd {
Diff(verbs::diff::Args),
/// Show title + body + comments.
View(verbs::view::Args),
/// Edit the PR's title / body / state / milestone. Fields you don't
/// pass keep their current value.
Edit(verbs::issue_edit::Args),
/// Edit the PR's title / body / state / milestone / base branch. Fields
/// you don't pass keep their current value.
Edit(verbs::pr_edit::PrEditArgs),
/// Post a comment on the PR.
Comment(verbs::comment::Args),
/// List comments on the PR.
@ -81,8 +81,8 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
verbs::view::run(client, a)
}
Cmd::Edit(a) => {
assert_kind(client, a.number, Kind::Pr)?;
verbs::issue_edit::run(client, a)
assert_kind(client, a.edit.number, Kind::Pr)?;
verbs::pr_edit::run(client, a)
}
Cmd::Comment(a) => {
assert_kind(client, a.number, Kind::Pr)?;