Closed
Description
- Gitea version (or commit ref): 2ecf98e
Description
When I attempt to merge a PR that doesn't have enough approvals, the [Merge]
button shows up in red and the message "As an administrator, you may still merge this pull request" is displayed. However, when I push the [Merge]
button, a 500 Server Error
page shows up with the following error:
git push: remote: Gitea: Not allowed to push to protected branch master and pr #68 is not ready to be merged: not allowed to merge [reason: Does not have enough approvals]
To /home/giteatest/gitea-repositories/user2/miomiomio.git
! [remote rejected] base -> master (pre-receive hook declined)
error: failed to push some refs to '/home/giteatest/gitea-repositories/user2/miomiomio.git'
Stack trace:
2020/01/12 20:36:05 ...ters/private/hook.go:145:HookPreReceive() [W] Forbidden: User 39 is not allowed push to protected branch master in 82473
8599184:user2/miomiomio and pr #1 is not ready to be merged: not allowed to merge [reason: Does not have enough approvals]
2020/01/12 20:36:05 routers/repo/pull.go:712:MergePullRequest() [E] Merge: git push: remote: Gitea: Not allowed to push to protected branch mas
ter and pr #68 is not ready to be merged: not allowed to merge [reason: Does not have enough approvals]
To /home/giteatest/gitea-repositories/user2/miomiomio.git
! [remote rejected] base -> master (pre-receive hook declined)
error: failed to push some refs to '/home/giteatest/gitea-repositories/user2/miomiomio.git'
/home/guillep2k/src/code.gitea.io/gitea/routers/repo/pull.go:712 (0x1471838)
MergePullRequest: ctx.ServerError("Merge", err)
/home/guillep2k/go/src/reflect/value.go:460 (0x49e935)
Value.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))
/home/guillep2k/go/src/reflect/value.go:321 (0x49e0f3)
Value.Call: return v.call("Call", in)
/home/v/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0x9bc749)
(*injector).callInvoke: return reflect.ValueOf(f).Call(in), nil
(etc)
User 39
is the owner of the repository and the user I'm logged in for the merge operation.