Fix commit_status problem when testing (#29672) (#29675)

Backport #29672 by @charles7668

Close #29661

fix #29656

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
(cherry picked from commit 1f897637441a9a5c43e01b84e374d836d9260a00)
This commit is contained in:
Giteabot 2024-03-09 00:04:23 +08:00 committed by Earl Warren
parent 66061d2828
commit e811f3b185
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

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