mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
* Fix wrong hint when status checking is running on pull request view * fix lint * fix test * fix test * fix wrong tmpl * fix import * rename function name
This commit is contained in:
@@ -53,7 +53,7 @@ func NewCommitStatus(ctx *context.APIContext, form api.CreateStatusOption) {
|
||||
return
|
||||
}
|
||||
status := &models.CommitStatus{
|
||||
State: models.CommitStatusState(form.State),
|
||||
State: api.CommitStatusState(form.State),
|
||||
TargetURL: form.TargetURL,
|
||||
Description: form.Description,
|
||||
Context: form.Context,
|
||||
@@ -220,13 +220,13 @@ func getCommitStatuses(ctx *context.APIContext, sha string) {
|
||||
}
|
||||
|
||||
type combinedCommitStatus struct {
|
||||
State models.CommitStatusState `json:"state"`
|
||||
SHA string `json:"sha"`
|
||||
TotalCount int `json:"total_count"`
|
||||
Statuses []*api.Status `json:"statuses"`
|
||||
Repo *api.Repository `json:"repository"`
|
||||
CommitURL string `json:"commit_url"`
|
||||
URL string `json:"url"`
|
||||
State api.CommitStatusState `json:"state"`
|
||||
SHA string `json:"sha"`
|
||||
TotalCount int `json:"total_count"`
|
||||
Statuses []*api.Status `json:"statuses"`
|
||||
Repo *api.Repository `json:"repository"`
|
||||
CommitURL string `json:"commit_url"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
// GetCombinedCommitStatusByRef returns the combined status for any given commit hash
|
||||
@@ -293,7 +293,7 @@ func GetCombinedCommitStatusByRef(ctx *context.APIContext) {
|
||||
retStatus.Statuses = make([]*api.Status, 0, len(statuses))
|
||||
for _, status := range statuses {
|
||||
retStatus.Statuses = append(retStatus.Statuses, status.APIFormat())
|
||||
if status.State.IsWorseThan(retStatus.State) {
|
||||
if status.State.NoBetterThan(retStatus.State) {
|
||||
retStatus.State = status.State
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user