You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refuse a Merged Branch Delete Where Another Open Pull Request Uses the Branch #2969
Deleting a merged feature branch, by the hand form drive-pr and merge-and-release prescribe or by pr_review.py cleanup (#2967), can close another open pull request. A branch that is also the head of a second open pull request (into another base), or the base of a stacked one, passes every current check, since the tip still matches the merged pull request's headRefOid, and GitHub closes the other pull request when the branch goes.
Neither the skills nor the subcommand look for another open pull request on the branch before deleting it.
Proposed Fix
Before the delete, read the open pull requests whose head or base is that branch in the same repository, and refuse where any exists, naming them. cleanup exits 1 for that refusal, and the hand form in both skills gains the same check.
GitHub's "Restore branch" recovers a deleted head, so this is a recoverable gap rather than data loss, which is why it was filed rather than fixed in #2967.
Activity
Delete a Merged Feature Branch Through a pr_review.py cleanup Subcomm…
Refuse a Branch Delete Another Open Pull Request Uses and Drop the Ha…