aboutsummaryrefslogtreecommitdiffstats
path: root/services/org/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/org/repo.go')
-rw-r--r--services/org/repo.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/org/repo.go b/services/org/repo.go
index 0edbf2d464..78a829ef25 100644
--- a/services/org/repo.go
+++ b/services/org/repo.go
@@ -14,14 +14,14 @@ import (
)
// TeamAddRepository adds new repository to team of organization.
-func TeamAddRepository(t *organization.Team, repo *repo_model.Repository) (err error) {
+func TeamAddRepository(ctx context.Context, t *organization.Team, repo *repo_model.Repository) (err error) {
if repo.OwnerID != t.OrgID {
return errors.New("repository does not belong to organization")
- } else if organization.HasTeamRepo(db.DefaultContext, t.OrgID, t.ID, repo.ID) {
+ } else if organization.HasTeamRepo(ctx, t.OrgID, t.ID, repo.ID) {
return nil
}
- return db.WithTx(db.DefaultContext, func(ctx context.Context) error {
+ return db.WithTx(ctx, func(ctx context.Context) error {
return models.AddRepository(ctx, t, repo)
})
}