fj pr merge 405s on squash-only repos (no way to select merge method) #201
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
fj pr merge <n>fails with HTTP 405 Method Not Allowed on a repo that only allows squash merges, even when the PR is fully mergeable (mergeable: true, checks green, no required reviewers).fj pr mergealso exposes no flag to pick the merge method:Root cause (hypothesis)
Forgejo's merge endpoint
POST /repos/{owner}/{repo}/pulls/{n}/mergetakes aDofield (merge/squash/rebase/rebase-merge).fj pr mergeappears to hardcodeDo: mergewith no way to override. When the repo disables merge commits, Forgejo rejects the disallowed style with 405. The repo's actual allowed/default style is ignored.Confirmed on the repo in question:
Workaround
Post the merge with the allowed style directly:
This succeeds and the PR merges.
Suggestions
fj pr merge(e.g.--squash/--merge/--rebase, or--method <style>).Dovalue to the repo'sdefault_merge_style(fromGET /repos/{o}/{r}) instead of hardcodingmerge; fall back to the first allowed style.Environment