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/routers/web
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 Provide the ability to set password hash algorithm parameters (#22942) (#22943) 2 years ago
auth Provide the ability to set password hash algorithm parameters (#22942) (#22943) 2 years ago
dev Make better use of i18n (#20096) 3 years ago
events Improve Stopwatch behavior (#18930) 3 years ago
explore Fix sorting admin user list by last login (#22081) (#22107) 2 years ago
feed Fix setting HTTP headers after write (#21833) (#21877) 2 years ago
healthcheck Update go-chi/cache to utilize Ping() (#19719) 3 years ago
misc Fix panic in team repos API (#19431) 3 years ago
org Fix leaving organization bug on user settings -> orgs (#21983) (#22438) 2 years ago
repo Add force_merge to merge request and fix checking mergable (#23010) (#23032) 2 years ago
user Provide the ability to set password hash algorithm parameters (#22942) (#22943) 2 years ago
auth.go Remove legacy `+build:` constraint (#19582) 3 years ago
auth_windows.go Let web and API routes have different auth methods group (#19168) 3 years ago
base.go Share HTML template renderers and create a watcher framework (#20218) 3 years ago
goget.go Refactor legacy `unknwon/com` package, improve golangci lint (#19284) 3 years ago
home.go Add sitemap support (#18407) 3 years ago
metrics.go Update HTTP status codes to modern codes (#18063) 3 years ago
nodeinfo.go Add nodeinfo endpoint for federation purposes (#16953) 4 years ago
swagger_json.go Refactor routers directory (#15800) 4 years ago
web.go Fix permission check on issue/pull lock (#22113) 2 years ago
webfinger.go Fix various typos (#20338) 3 years ago