mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Small refactor for loading PRs (#22652)
This commit is contained in:
		@@ -173,8 +173,9 @@ func (prs PullRequestList) loadAttributes(ctx context.Context) error {
 | 
				
			|||||||
	for i := range issues {
 | 
						for i := range issues {
 | 
				
			||||||
		set[issues[i].ID] = issues[i]
 | 
							set[issues[i].ID] = issues[i]
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	for i := range prs {
 | 
						for _, pr := range prs {
 | 
				
			||||||
		prs[i].Issue = set[prs[i].IssueID]
 | 
							pr.Issue = set[pr.IssueID]
 | 
				
			||||||
 | 
							pr.Issue.PullRequest = pr // panic here means issueIDs and prs are not in sync
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -298,7 +298,6 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
 | 
				
			|||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					pr.Issue.PullRequest = pr
 | 
					 | 
				
			||||||
					notification.NotifyPullRequestSynchronized(ctx, doer, pr)
 | 
										notification.NotifyPullRequestSynchronized(ctx, doer, pr)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user