Skip to content

Commit

Permalink
Fix commit status in repo list (#28412)
Browse files Browse the repository at this point in the history
  • Loading branch information
yp05327 authored Dec 11, 2023
1 parent 5b2bbf1 commit 0abb563
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion models/git/commit_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion routers/web/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0abb563

Please # to comment.