You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/services/forms
Jason Song 90982bffa5
Add force_merge to merge request and fix checking mergable (#23010) (#23032)
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.
2 years ago
..
admin.go Add Visible modes function from Organisation to Users too (#16069) 4 years ago
auth_form.go Revert unrelated changes for SMTP auth (#21767) (#21768) 2 years ago
org.go Team permission allow different unit has different permission (#17811) 3 years ago
repo_branch_form.go Keep path when creating a new branch (#21153) 2 years ago
repo_form.go Add force_merge to merge request and fix checking mergable (#23010) (#23032) 2 years ago
repo_form_test.go format with gofumpt (#18184) 3 years ago
repo_tag_form.go Add tag protection (#15629) 4 years ago
user_form.go Record OAuth client type at registration (#21316) 2 years ago
user_form_auth_openid.go Add support mCaptcha as captcha provider (#20458) 3 years ago
user_form_hidden_comments.go Move issues related files into models/issues (#19931) 3 years ago
user_form_test.go Move modules/forms to services/forms (#15305) 4 years ago