Closed
Description
Description
Currently, when you delete a branch, all PRs still targeting this branch will be closed forever, breaking them completely if you intend to merge them into another branch, i.e. the target branch of a PR that deleted the branch.
The result of this bug is that even if you attempt to reopen such a PR, you simply won't be able to:
The PR cannot be reopened because the branch does not exist, and the branch can't be changed because the PR is closed.
Reproduction Steps
- Create the first branch with some changes
- Create the second branch with more changes from the first branch
- Open PRs in both branches, with the first branch targeting anything, and the second branch targeting the first branch
- Merge the PR of the first branch, making sure to delete the first branch with it
- Enjoy the second PR being broken
Reproduction PR: https://try.gitea.io/delvh/kanban-test/pulls/23
Possible Solutions
- Allow changing the target branches for closed (but not merged?) PRs (most likely solution)
- Allow (re)opening PRs whose target branch is missing (unlikely, leads to too many errors)
- Automatically change the target of such PRs to the target of the closing branch (unlikely, works only in the reproduction setup, and is somewhat counter-intuitive for a user)
Gitea Version
1.16.4 to 1.17.0+dev-327-gf7883a6ae
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
(The red box in this case comes from trying to edit the target branch to reopen the PR)
Git Version
No response
Operating System
No response
How are you running Gitea?
try.gitea.io
Database
No response