diff options
author | 6543 <6543@obermui.de> | 2020-04-15 22:35:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 21:35:18 +0100 |
commit | a88f3663eb162f2a2558c3a957087a680bdd8ce6 (patch) | |
tree | fb0c113aa20c820578e2e28f86aaa716c040f913 /routers/repo/pull.go | |
parent | 8cdb6662c8154a840a1ba547599e2847a1b80d17 (diff) | |
download | gitea-a88f3663eb162f2a2558c3a957087a680bdd8ce6.tar.gz gitea-a88f3663eb162f2a2558c3a957087a680bdd8ce6.zip |
Fix merge dialog on protected branch with missing required statuses (#11074)
It is possible for misconfigured protected branches to have required status checks that are not in any of the current statuses: Pending, Success, Error, Failure, or Warning - presumably because the CI has not contacted us as yet.
Fix #10636 by adding case: missing StatusChecks when these are missing
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r-- | routers/repo/pull.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 00195fd02a..63cc39865c 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -451,9 +451,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare } return false } - state := pull_service.MergeRequiredContextsCommitStatus(commitStatuses, pull.ProtectedBranch.StatusCheckContexts) - ctx.Data["RequiredStatusCheckState"] = state - ctx.Data["IsRequiredStatusCheckSuccess"] = state.IsSuccess() + ctx.Data["RequiredStatusCheckState"] = pull_service.MergeRequiredContextsCommitStatus(commitStatuses, pull.ProtectedBranch.StatusCheckContexts) } ctx.Data["HeadBranchMovedOn"] = headBranchSha != sha |