mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-18 14:58:15 +02:00
fix status check in MergeRequiredContextsCommitStatus
This commit is contained in:
@@ -61,6 +61,11 @@ func MergeRequiredContextsCommitStatus(commitStatuses []*git_model.CommitStatus,
|
||||
if matchedCount == 0 && returnedStatus == structs.CommitStatusSuccess {
|
||||
status := git_model.CalcCommitStatus(commitStatuses)
|
||||
if status != nil {
|
||||
// FIXME: this check is not right, "status" can never be nil, but its fields can be empty if commitStatuses is empty
|
||||
// here is just a quick patch to make it overall right.
|
||||
if status.State == "" || status.State == structs.CommitStatusSkipped {
|
||||
return structs.CommitStatusSuccess
|
||||
}
|
||||
return status.State
|
||||
}
|
||||
return structs.CommitStatusSuccess
|
||||
|
||||
Reference in New Issue
Block a user