aboutsummaryrefslogtreecommitdiffstats
path: root/models/issues/pull_list.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issues/pull_list.go')
-rw-r--r--models/issues/pull_list.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/models/issues/pull_list.go b/models/issues/pull_list.go
index 59010aa9d0..1ddb94e566 100644
--- a/models/issues/pull_list.go
+++ b/models/issues/pull_list.go
@@ -166,6 +166,23 @@ func (prs PullRequestList) getRepositoryIDs() []int64 {
return repoIDs.Values()
}
+func (prs PullRequestList) SetBaseRepo(baseRepo *repo_model.Repository) {
+ for _, pr := range prs {
+ if pr.BaseRepo == nil {
+ pr.BaseRepo = baseRepo
+ }
+ }
+}
+
+func (prs PullRequestList) SetHeadRepo(headRepo *repo_model.Repository) {
+ for _, pr := range prs {
+ if pr.HeadRepo == nil {
+ pr.HeadRepo = headRepo
+ pr.isHeadRepoLoaded = true
+ }
+ }
+}
+
func (prs PullRequestList) LoadRepositories(ctx context.Context) error {
repoIDs := prs.getRepositoryIDs()
reposMap := make(map[int64]*repo_model.Repository, len(repoIDs))