diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-02-02 11:49:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-01 21:49:28 -0600 |
commit | 4e946e5a7d79c3a933eefc8584444bc02f52b874 (patch) | |
tree | beedc90414917e1900d24e857fe5b7188981c730 /models | |
parent | 3f2e7213720c299b3cace485e97584f0b512bcb7 (diff) | |
download | gitea-4e946e5a7d79c3a933eefc8584444bc02f52b874.tar.gz gitea-4e946e5a7d79c3a933eefc8584444bc02f52b874.zip |
Small refactor for loading PRs (#22652)
Diffstat (limited to 'models')
-rw-r--r-- | models/issues/pull_list.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/models/issues/pull_list.go b/models/issues/pull_list.go index 12dbff107d..007c2fd903 100644 --- a/models/issues/pull_list.go +++ b/models/issues/pull_list.go @@ -173,8 +173,9 @@ func (prs PullRequestList) loadAttributes(ctx context.Context) error { for i := range issues { set[issues[i].ID] = issues[i] } - for i := range prs { - prs[i].Issue = set[prs[i].IssueID] + for _, pr := range prs { + pr.Issue = set[pr.IssueID] + pr.Issue.PullRequest = pr // panic here means issueIDs and prs are not in sync } return nil } |