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/api/v1
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
..
activitypub Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
admin Provide the ability to set password hash algorithm parameters (#22942) (#22943) 2 years ago
misc Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
notify Move some files into models' sub packages (#20262) 3 years ago
org [API] teamSearch show teams with no members if user is admin (#21204) 2 years ago
packages Add support for Vagrant packages (#20930) 3 years ago
repo Add force_merge to merge request and fix checking mergable (#23010) (#23032) 2 years ago
settings Make mirror feature more configurable (#16957) 4 years ago
swagger Add API endpoint to get changed files of a PR (#21177) 2 years ago
user Record OAuth client type at registration (#21316) 2 years ago
utils Use complete SHA to create and query commit status (#22244) (#22257) 2 years ago
api.go Prevent panic on looking at api "git" endpoints for empty repos (#22457) (#22458) 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