mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-18 13:02:54 +02:00
add comment for CalcCommitStatus
This commit is contained in:
parent
e9b8a15000
commit
e6dc1862ec
@ -230,6 +230,10 @@ func (status *CommitStatus) HideActionsURL(ctx context.Context) {
|
||||
|
||||
// CalcCommitStatus returns commit status state via some status, the commit statues should order by id desc
|
||||
func CalcCommitStatus(statuses []*CommitStatus) *CommitStatus {
|
||||
// This function is widely used, but it is not quite right.
|
||||
// The bad case is: if all commits are "skipped", GitHub will return "success" as the combined status.
|
||||
// But here Gitea just returns the first status, which is still "skipped" in this case.
|
||||
// Ideally it should return something like "CommitStatusSummary" with proper aggregated state.
|
||||
var lastStatus *CommitStatus
|
||||
state := api.CommitStatusSuccess
|
||||
for _, status := range statuses {
|
||||
|
Loading…
x
Reference in New Issue
Block a user