mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix commit status in repo list (#28412)
Before:   `TestOrg/testactions` does have commit status, but won't display in `All` After:  Same to #26179.
This commit is contained in:
		@@ -323,7 +323,9 @@ func GetLatestCommitStatusForPairs(ctx context.Context, repoIDsToLatestCommitSHA
 | 
				
			|||||||
		Select("max( id ) as id, repo_id").
 | 
							Select("max( id ) as id, repo_id").
 | 
				
			||||||
		GroupBy("context_hash, repo_id").OrderBy("max( id ) desc")
 | 
							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)
 | 
						err := sess.Find(&results)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -606,7 +606,7 @@ func SearchRepo(ctx *context.Context) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// call the database O(1) times to get the commit statuses for all repos
 | 
						// 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 {
 | 
						if err != nil {
 | 
				
			||||||
		log.Error("GetLatestCommitStatusForPairs: %v", err)
 | 
							log.Error("GetLatestCommitStatusForPairs: %v", err)
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user