aboutsummaryrefslogtreecommitdiffstats
path: root/services/pull
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 /services/pull
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 'services/pull')
-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 51ba06da27..39d60380ff 100644
--- a/services/pull/commit_status.go
+++ b/services/pull/commit_status.go
@@ -143,7 +143,7 @@ func GetPullRequestCommitStatusState(ctx context.Context, pr *issues_model.PullR
return "", errors.Wrap(err, "LoadBaseRepo")
}
- commitStatuses, _, err := git_model.GetLatestCommitStatus(ctx, pr.BaseRepo.ID, sha, db.ListOptions{})
+ commitStatuses, _, err := git_model.GetLatestCommitStatus(ctx, pr.BaseRepo.ID, sha, db.ListOptions{ListAll: true})
if err != nil {
return "", errors.Wrap(err, "GetLatestCommitStatus")
}
diff --git a/services/pull/pull.go b/services/pull/pull.go
index 8c0b65fd8b..cf49d2fe20 100644
--- a/services/pull/pull.go
+++ b/services/pull/pull.go
@@ -804,7 +804,7 @@ func getAllCommitStatus(gitRepo *git.Repository, pr *issues_model.PullRequest) (
return nil, nil, shaErr
}
- statuses, _, err = git_model.GetLatestCommitStatus(db.DefaultContext, pr.BaseRepo.ID, sha, db.ListOptions{})
+ statuses, _, err = git_model.GetLatestCommitStatus(db.DefaultContext, pr.BaseRepo.ID, sha, db.ListOptions{ListAll: true})
lastStatus = git_model.CalcCommitStatus(statuses)
return statuses, lastStatus, err
}