aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorcaicandong <50507092+CaiCandong@users.noreply.github.com>2023-07-31 10:21:09 +0800
committerGitHub <noreply@github.com>2023-07-31 02:21:09 +0000
commit983167cf49cd64c7a1f28c39aff03e00dd387990 (patch)
treea83bc57f7d441c0027a58e7ac0e7855f5940ffb3 /models
parentea385f5d39a286ec36f3735fc7c5211b141f6165 (diff)
downloadgitea-983167cf49cd64c7a1f28c39aff03e00dd387990.tar.gz
gitea-983167cf49cd64c7a1f28c39aff03e00dd387990.zip
Fix pull request check list is limited (#26179)
In the original implementation, we can only get the first 30 records of the commit status (the default paging size), if the commit status is more than 30, it will lead to the bug #25990. I made the following two changes. - On the page, use the ` db.ListOptions{ListAll: true}` parameter instead of `db.ListOptions{}` - The `GetLatestCommitStatus` function makes a determination as to whether or not a pager is being used. fixed #25990
Diffstat (limited to 'models')
-rw-r--r--models/git/commit_status.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/git/commit_status.go b/models/git/commit_status.go
index 17090f30dd..e7616fb167 100644
--- a/models/git/commit_status.go
+++ b/models/git/commit_status.go
@@ -283,9 +283,9 @@ func GetLatestCommitStatus(ctx context.Context, repoID int64, sha string, listOp
Where("repo_id = ?", repoID).And("sha = ?", sha).
Select("max( id ) as id").
GroupBy("context_hash").OrderBy("max( id ) desc")
-
- sess = db.SetSessionPagination(sess, &listOptions)
-
+ if !listOptions.IsListAll() {
+ sess = db.SetSessionPagination(sess, &listOptions)
+ }
count, err := sess.FindAndCount(&ids)
if err != nil {
return nil, count, err