diff --git a/models/git/commit_status.go b/models/git/commit_status.go index acb011020056..097ce01c1442 100644 --- a/models/git/commit_status.go +++ b/models/git/commit_status.go @@ -323,7 +323,9 @@ func GetLatestCommitStatusForPairs(ctx context.Context, repoIDsToLatestCommitSHA Select("max( id ) as id, repo_id"). GroupBy("context_hash, repo_id").OrderBy("max( id ) desc") - sess = db.SetSessionPagination(sess, &listOptions) + if !listOptions.IsListAll() { + sess = db.SetSessionPagination(sess, &listOptions) + } err := sess.Find(&results) if err != nil { diff --git a/routers/web/repo/repo.go b/routers/web/repo/repo.go index b3b6b48871a0..482fbaac2bc5 100644 --- a/routers/web/repo/repo.go +++ b/routers/web/repo/repo.go @@ -606,7 +606,7 @@ func SearchRepo(ctx *context.Context) { } // call the database O(1) times to get the commit statuses for all repos - repoToItsLatestCommitStatuses, err := git_model.GetLatestCommitStatusForPairs(ctx, repoIDsToLatestCommitSHAs, db.ListOptions{}) + repoToItsLatestCommitStatuses, err := git_model.GetLatestCommitStatusForPairs(ctx, repoIDsToLatestCommitSHAs, db.ListOptionsAll) if err != nil { log.Error("GetLatestCommitStatusForPairs: %v", err) return