Allow repo admin to merge PR regardless of review status (#9611)

* Allow repo admin to merge even if review is not ok.
This commit is contained in:
David Svantesson 2020-01-11 08:29:34 +01:00 committed by techknowlogick
parent 4d06d10dba
commit 32fb813133
13 changed files with 236 additions and 124 deletions

View file

@ -448,6 +448,7 @@ type MergePullRequestForm struct {
Do string `binding:"Required;In(merge,rebase,rebase-merge,squash)"`
MergeTitleField string
MergeMessageField string
ForceMerge *bool `json:"force_merge,omitempty"`
}
// Validate validates the fields

View file

@ -51,7 +51,7 @@ func ToBranch(repo *models.Repository, b *git.Branch, c *git.Commit, bp *models.
EnableStatusCheck: bp.EnableStatusCheck,
StatusCheckContexts: bp.StatusCheckContexts,
UserCanPush: bp.CanUserPush(user.ID),
UserCanMerge: bp.CanUserMerge(user.ID),
UserCanMerge: bp.IsUserMergeWhitelisted(user.ID),
}
}