mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-12-11 05:51:57 +01:00
90982bffa5
Backport #23010. Fix #23000. The bug was introduced in #22633, and it seems that it has been noticed: https://github.com/go-gitea/gitea/pull/22633#discussion_r1095395359 . However, #22633 did nothing wrong, the logic should be "check if they is admin only when `force` is true". So we should provide the `ForceMerge` when merging from UI. After this, an admin can also send a normal merge request with `ForceMerge` false. So it fixes a potential bug: if the admin doesn't want to do a force merge, they just see the green "Merge" button and click it. At the same time, the status of the PR changed, and it shouldn't be merged now, so the admin could send an unexpected force merge. In addition, I updated `ForceMerge *bool` to `ForceMerge bool`, I don't see the reason to use a pointer. And fixed the logic of CheckPullMergable to handle auto merge and force merge correctly. |
||
---|---|---|
.. | ||
admin.go | ||
auth_form.go | ||
org.go | ||
repo_branch_form.go | ||
repo_form.go | ||
repo_form_test.go | ||
repo_tag_form.go | ||
user_form.go | ||
user_form_auth_openid.go | ||
user_form_hidden_comments.go | ||
user_form_test.go |