Skip to content

Commit

Permalink
Small refactor for loading PRs (go-gitea#22652)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored Feb 2, 2023
1 parent 3f2e721 commit 4e946e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions models/issues/pull_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion services/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
}
}

pr.Issue.PullRequest = pr
notification.NotifyPullRequestSynchronized(ctx, doer, pr)
}
}
Expand Down

0 comments on commit 4e946e5

Please sign in to comment.