Fix commit_status problem when testing (#29672)

Close #29661

fix #29656

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 0c273f12e0b5d6dc2b80e2e6b51b2deaf15608b1)
This commit is contained in:
charles 2024-03-08 23:43:48 +08:00 committed by Earl Warren
parent 4511287676
commit e731e0c346
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -60,7 +60,7 @@ func MergeRequiredContextsCommitStatus(commitStatuses []*git_model.CommitStatus,
}
}
if matchedCount == 0 {
if matchedCount == 0 && returnedStatus == structs.CommitStatusSuccess {
status := git_model.CalcCommitStatus(commitStatuses)
if status != nil {
return status.State