mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-06 18:24:39 +08:00
Disable merging a WIP Pull request (#4529)
* prevent pull request to be merged when PR is a WIP * add tests * add helper to prepend WIP: in PR title * move default wip prefixes into settings * use configurable WIP prefixes in javascript and default to first one in templates * add documentation * add unit test on pull model Signed-off-by: Julien Tant <julien@craftyx.fr>
This commit is contained in:
@ -510,7 +510,7 @@ func MergePullRequest(ctx *context.APIContext, form auth.MergePullRequestForm) {
|
||||
return
|
||||
}
|
||||
|
||||
if !pr.CanAutoMerge() || pr.HasMerged {
|
||||
if !pr.CanAutoMerge() || pr.HasMerged || pr.IsWorkInProgress() {
|
||||
ctx.Status(405)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user