diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-12-10 10:46:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-10 10:46:31 +0800 |
commit | 68704532c28cf09db96c988291b2f82c5e615984 (patch) | |
tree | c6537092dc11054f96b202fdb957755ed116cd99 /tests/integration/api_repo_edit_test.go | |
parent | 097d4e30b180eef30600beef2c08095e2571319c (diff) | |
download | gitea-68704532c28cf09db96c988291b2f82c5e615984.tar.gz gitea-68704532c28cf09db96c988291b2f82c5e615984.zip |
Rename almost all Ctx functions (#22071)
Diffstat (limited to 'tests/integration/api_repo_edit_test.go')
-rw-r--r-- | tests/integration/api_repo_edit_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/integration/api_repo_edit_test.go b/tests/integration/api_repo_edit_test.go index 47e07f8d4b..716cebeb7c 100644 --- a/tests/integration/api_repo_edit_test.go +++ b/tests/integration/api_repo_edit_test.go @@ -9,6 +9,7 @@ import ( "net/url" "testing" + "code.gitea.io/gitea/models/db" repo_model "code.gitea.io/gitea/models/repo" unit_model "code.gitea.io/gitea/models/unit" "code.gitea.io/gitea/models/unittest" @@ -27,7 +28,7 @@ func getRepoEditOptionFromRepo(repo *repo_model.Repository) *api.EditRepoOption hasIssues := false var internalTracker *api.InternalTracker var externalTracker *api.ExternalTracker - if unit, err := repo.GetUnit(unit_model.TypeIssues); err == nil { + if unit, err := repo.GetUnit(db.DefaultContext, unit_model.TypeIssues); err == nil { config := unit.IssuesConfig() hasIssues = true internalTracker = &api.InternalTracker{ @@ -35,7 +36,7 @@ func getRepoEditOptionFromRepo(repo *repo_model.Repository) *api.EditRepoOption AllowOnlyContributorsToTrackTime: config.AllowOnlyContributorsToTrackTime, EnableIssueDependencies: config.EnableDependencies, } - } else if unit, err := repo.GetUnit(unit_model.TypeExternalTracker); err == nil { + } else if unit, err := repo.GetUnit(db.DefaultContext, unit_model.TypeExternalTracker); err == nil { config := unit.ExternalTrackerConfig() hasIssues = true externalTracker = &api.ExternalTracker{ @@ -47,9 +48,9 @@ func getRepoEditOptionFromRepo(repo *repo_model.Repository) *api.EditRepoOption } hasWiki := false var externalWiki *api.ExternalWiki - if _, err := repo.GetUnit(unit_model.TypeWiki); err == nil { + if _, err := repo.GetUnit(db.DefaultContext, unit_model.TypeWiki); err == nil { hasWiki = true - } else if unit, err := repo.GetUnit(unit_model.TypeExternalWiki); err == nil { + } else if unit, err := repo.GetUnit(db.DefaultContext, unit_model.TypeExternalWiki); err == nil { hasWiki = true config := unit.ExternalWikiConfig() externalWiki = &api.ExternalWiki{ @@ -63,7 +64,7 @@ func getRepoEditOptionFromRepo(repo *repo_model.Repository) *api.EditRepoOption allowRebase := false allowRebaseMerge := false allowSquash := false - if unit, err := repo.GetUnit(unit_model.TypePullRequests); err == nil { + if unit, err := repo.GetUnit(db.DefaultContext, unit_model.TypePullRequests); err == nil { config := unit.PullRequestsConfig() hasPullRequests = true ignoreWhitespaceConflicts = config.IgnoreWhitespaceConflicts |