mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
fix: correctly compute required commit status (#10747)
We need to take all matching required status into account to get the desired status because there can be some pending. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10747 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
parent
fda54d59b8
commit
055973ce8c
2 changed files with 8 additions and 7 deletions
|
|
@ -39,9 +39,12 @@ func MergeRequiredContextsCommitStatus(commitStatuses []*git_model.CommitStatus,
|
|||
var targetStatus structs.CommitStatusState
|
||||
for _, commitStatus := range commitStatuses {
|
||||
if gp.Match(commitStatus.Context) {
|
||||
targetStatus = commitStatus.State
|
||||
if targetStatus == "" {
|
||||
targetStatus = commitStatus.State
|
||||
} else if commitStatus.State.NoBetterThan(targetStatus) {
|
||||
targetStatus = commitStatus.State
|
||||
}
|
||||
matchedCount++
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue