1
0
Fork 0
forked from forgejo/forgejo

[BUG] Fix pull request reopen conditions

- Move the conditions code around, such that the existence of the head
and base is first checked (so a clear error can be given, instead of a
possible server error). This makes it easier to read this code. As the
logic is now grouped together.
- Adds integration testing that simulates the deletion of the base and
head branch and ensures the pull request cannot be opened. The 'normal'
testcase also 'informally' ensures that the previous incorrect condition
is not there, because the branch `base-branch` doesn't exist on the head
repository.
- Resolves #2321
This commit is contained in:
Gusted 2024-02-17 15:30:41 +01:00
parent 7bf93e5d1a
commit f779aa79f2
No known key found for this signature in database
GPG key ID: FD821B732837125F
3 changed files with 234 additions and 11 deletions

View file

@ -1859,6 +1859,8 @@ pulls.cmd_instruction_merge_title = Merge
pulls.cmd_instruction_merge_desc = Merge the changes and update on Forgejo.
pulls.clear_merge_message = Clear merge message
pulls.clear_merge_message_hint = Clearing the merge message will only remove the commit message content and keep generated git trailers such as "Co-Authored-By …".
pulls.reopen_failed.head_branch = The pull request cannot be reopened, because the head branch doesn't exist anymore.
pulls.reopen_failed.base_branch = The pull request cannot be reopened, because the base branch doesn't exist anymore.
pulls.auto_merge_button_when_succeed = (When checks succeed)
pulls.auto_merge_when_succeed = Auto merge when all checks succeed