summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-18 03:33:32 +0000
committerGitHub <noreply@github.com>2020-12-18 11:33:32 +0800
commite483220ea3c54137cec543842261f99c4696129a (patch)
tree2f81f173315b8ebe92403290977c09bfc32bf754 /services
parent27edc1aa19afb043a497a7dc628afa420cb1de55 (diff)
downloadgitea-e483220ea3c54137cec543842261f99c4696129a.tar.gz
gitea-e483220ea3c54137cec543842261f99c4696129a.zip
[Refactor] CombinedStatus and CommitStatus related functions & structs (#14026)
* RM unused struct * rename (*CommitStatus) loadRepo() -> loadAttributes() * move ToCommitStatus into its own file * use CommitStatusState instead of StatusState * move CombinedStatus convertion into convert package * let models.GetLatestCommitStatus use repoID direct and accept ListOptions * update swagger docs * fix tests * Fix swagger docs * rm page * fix swagger docs!!! * return json null * always return json * rename api.Status to api.CommitStatus * fix swagger docs * sec swagger fix
Diffstat (limited to 'services')
-rw-r--r--services/pull/commit_status.go2
-rw-r--r--services/pull/pull.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/commit_status.go b/services/pull/commit_status.go
index 592aad6fc5..b8fb109440 100644
--- a/services/pull/commit_status.go
+++ b/services/pull/commit_status.go
@@ -121,7 +121,7 @@ func GetPullRequestCommitStatusState(pr *models.PullRequest) (structs.CommitStat
return "", errors.Wrap(err, "LoadBaseRepo")
}
- commitStatuses, err := models.GetLatestCommitStatus(pr.BaseRepo, sha, 0)
+ commitStatuses, err := models.GetLatestCommitStatus(pr.BaseRepo.ID, sha, models.ListOptions{})
if err != nil {
return "", errors.Wrap(err, "GetLatestCommitStatus")
}
diff --git a/services/pull/pull.go b/services/pull/pull.go
index 9cf4abfd54..f3fb762303 100644
--- a/services/pull/pull.go
+++ b/services/pull/pull.go
@@ -665,7 +665,7 @@ func GetLastCommitStatus(pr *models.PullRequest) (status *models.CommitStatus, e
return nil, err
}
- statusList, err := models.GetLatestCommitStatus(pr.BaseRepo, lastCommitID, 0)
+ statusList, err := models.GetLatestCommitStatus(pr.BaseRepo.ID, lastCommitID, models.ListOptions{})
if err != nil {
return nil, err
}