summaryrefslogtreecommitdiffstats
path: root/models/pull.go
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2020-01-11 08:29:34 +0100
committertechknowlogick <techknowlogick@gitea.io>2020-01-11 02:29:34 -0500
commit32fb813133c74ddc3af1964e81fff72fea4f24f1 (patch)
tree31eec446f12e448d7cf398db43620606e9704ff1 /models/pull.go
parent4d06d10dbafe7cfd404889b636d8e243058ee96f (diff)
downloadgitea-32fb813133c74ddc3af1964e81fff72fea4f24f1.tar.gz
gitea-32fb813133c74ddc3af1964e81fff72fea4f24f1.zip
Allow repo admin to merge PR regardless of review status (#9611)
* Allow repo admin to merge even if review is not ok.
Diffstat (limited to 'models/pull.go')
-rw-r--r--models/pull.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/models/pull.go b/models/pull.go
index e2a35c5920..bf2527679f 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -479,31 +479,6 @@ const (
MergeStyleSquash MergeStyle = "squash"
)
-// CheckUserAllowedToMerge checks whether the user is allowed to merge
-func (pr *PullRequest) CheckUserAllowedToMerge(doer *User) (err error) {
- if doer == nil {
- return ErrNotAllowedToMerge{
- "Not signed in",
- }
- }
-
- if pr.BaseRepo == nil {
- if err = pr.GetBaseRepo(); err != nil {
- return fmt.Errorf("GetBaseRepo: %v", err)
- }
- }
-
- if protected, err := pr.BaseRepo.IsProtectedBranchForMerging(pr, pr.BaseBranch, doer); err != nil {
- return fmt.Errorf("IsProtectedBranch: %v", err)
- } else if protected {
- return ErrNotAllowedToMerge{
- "The branch is protected",
- }
- }
-
- return nil
-}
-
// SetMerged sets a pull request to merged and closes the corresponding issue
func (pr *PullRequest) SetMerged() (err error) {
if pr.HasMerged {