summaryrefslogtreecommitdiffstats
path: root/services/pull
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-03-22 20:53:52 +0800
committerGitHub <noreply@github.com>2024-03-22 13:53:52 +0100
commitf8ab9dafb7a173a35e9308f8f784735b0f822439 (patch)
tree407c8062fd1943eac09af96b54c8521445c3e48c /services/pull
parent29118743a58cf3172bddb6a4fa287484c62b4eb1 (diff)
downloadgitea-f8ab9dafb7a173a35e9308f8f784735b0f822439.tar.gz
gitea-f8ab9dafb7a173a35e9308f8f784735b0f822439.zip
Use db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995)
Diffstat (limited to 'services/pull')
-rw-r--r--services/pull/commit_status.go2
-rw-r--r--services/pull/pull.go2
-rw-r--r--services/pull/review.go14
3 files changed, 7 insertions, 11 deletions
diff --git a/services/pull/commit_status.go b/services/pull/commit_status.go
index 653bfe6bcb..aa1ad7cd66 100644
--- a/services/pull/commit_status.go
+++ b/services/pull/commit_status.go
@@ -152,7 +152,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{ListAll: true})
+ commitStatuses, _, err := git_model.GetLatestCommitStatus(ctx, pr.BaseRepo.ID, sha, db.ListOptionsAll)
if err != nil {
return "", errors.Wrap(err, "GetLatestCommitStatus")
}
diff --git a/services/pull/pull.go b/services/pull/pull.go
index 8a9c6db917..4289e2e6e1 100644
--- a/services/pull/pull.go
+++ b/services/pull/pull.go
@@ -883,7 +883,7 @@ func getAllCommitStatus(ctx context.Context, gitRepo *git.Repository, pr *issues
return nil, nil, shaErr
}
- statuses, _, err = git_model.GetLatestCommitStatus(ctx, pr.BaseRepo.ID, sha, db.ListOptions{ListAll: true})
+ statuses, _, err = git_model.GetLatestCommitStatus(ctx, pr.BaseRepo.ID, sha, db.ListOptionsAll)
lastStatus = git_model.CalcCommitStatus(statuses)
return statuses, lastStatus, err
}
diff --git a/services/pull/review.go b/services/pull/review.go
index 8900ae2ab1..de1021c5c0 100644
--- a/services/pull/review.go
+++ b/services/pull/review.go
@@ -52,9 +52,7 @@ func InvalidateCodeComments(ctx context.Context, prs issues_model.PullRequestLis
issueIDs := prs.GetIssueIDs()
codeComments, err := db.Find[issues_model.Comment](ctx, issues_model.FindCommentsOptions{
- ListOptions: db.ListOptions{
- ListAll: true,
- },
+ ListOptions: db.ListOptionsAll,
Type: issues_model.CommentTypeCode,
Invalidated: optional.Some(false),
IssueIDs: issueIDs,
@@ -322,12 +320,10 @@ func SubmitReview(ctx context.Context, doer *user_model.User, gitRepo *git.Repos
// DismissApprovalReviews dismiss all approval reviews because of new commits
func DismissApprovalReviews(ctx context.Context, doer *user_model.User, pull *issues_model.PullRequest) error {
reviews, err := issues_model.FindReviews(ctx, issues_model.FindReviewOptions{
- ListOptions: db.ListOptions{
- ListAll: true,
- },
- IssueID: pull.IssueID,
- Type: issues_model.ReviewTypeApprove,
- Dismissed: optional.Some(false),
+ ListOptions: db.ListOptionsAll,
+ IssueID: pull.IssueID,
+ Type: issues_model.ReviewTypeApprove,
+ Dismissed: optional.Some(false),
})
if err != nil {
return err