1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-18 23:14:25 +01:00

Small refactor for loading PRs (#22652)

This commit is contained in:
Lunny Xiao 2023-02-02 11:49:28 +08:00 committed by GitHub
parent 3f2e721372
commit 4e946e5a7d
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

@ -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
}

@ -298,7 +298,6 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
}
}
pr.Issue.PullRequest = pr
notification.NotifyPullRequestSynchronized(ctx, doer, pr)
}
}