summaryrefslogtreecommitdiffstats
path: root/services/repository/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/repository/repository.go')
-rw-r--r--services/repository/repository.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/repository/repository.go b/services/repository/repository.go
index 859c32cf8f..41fae4b4cf 100644
--- a/services/repository/repository.go
+++ b/services/repository/repository.go
@@ -103,24 +103,24 @@ func UpdateRepository(repo *repo_model.Repository, visibilityChanged bool) (err
}
// LinkedRepository returns the linked repo if any
-func LinkedRepository(a *repo_model.Attachment) (*repo_model.Repository, unit.Type, error) {
+func LinkedRepository(ctx context.Context, a *repo_model.Attachment) (*repo_model.Repository, unit.Type, error) {
if a.IssueID != 0 {
- iss, err := issues_model.GetIssueByID(db.DefaultContext, a.IssueID)
+ iss, err := issues_model.GetIssueByID(ctx, a.IssueID)
if err != nil {
return nil, unit.TypeIssues, err
}
- repo, err := repo_model.GetRepositoryByID(iss.RepoID)
+ repo, err := repo_model.GetRepositoryByID(ctx, iss.RepoID)
unitType := unit.TypeIssues
if iss.IsPull {
unitType = unit.TypePullRequests
}
return repo, unitType, err
} else if a.ReleaseID != 0 {
- rel, err := repo_model.GetReleaseByID(db.DefaultContext, a.ReleaseID)
+ rel, err := repo_model.GetReleaseByID(ctx, a.ReleaseID)
if err != nil {
return nil, unit.TypeReleases, err
}
- repo, err := repo_model.GetRepositoryByID(rel.RepoID)
+ repo, err := repo_model.GetRepositoryByID(ctx, rel.RepoID)
return repo, unit.TypeReleases, err
}
return nil, -1, nil