diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-10 03:57:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 20:57:58 +0100 |
commit | 99b2858e628d92bba252be72def409af77af735b (patch) | |
tree | 56159cf10b271307911e6f01626c0c3efba789ab /integrations | |
parent | b6b1e716654fec3b16d245ef65cf42e57e1bb5b6 (diff) | |
download | gitea-99b2858e628d92bba252be72def409af77af735b.tar.gz gitea-99b2858e628d92bba252be72def409af77af735b.zip |
Move unit into models/unit/ (#17576)
* Move unit into models/unit/
* Rename unit.UnitType as unit.Type
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/api_repo_edit_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/integrations/api_repo_edit_test.go b/integrations/api_repo_edit_test.go index e980357a0f..f8e21a495b 100644 --- a/integrations/api_repo_edit_test.go +++ b/integrations/api_repo_edit_test.go @@ -12,6 +12,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" + unit_model "code.gitea.io/gitea/models/unit" api "code.gitea.io/gitea/modules/structs" "github.com/stretchr/testify/assert" @@ -26,7 +27,7 @@ func getRepoEditOptionFromRepo(repo *models.Repository) *api.EditRepoOption { hasIssues := false var internalTracker *api.InternalTracker var externalTracker *api.ExternalTracker - if unit, err := repo.GetUnit(models.UnitTypeIssues); err == nil { + if unit, err := repo.GetUnit(unit_model.TypeIssues); err == nil { config := unit.IssuesConfig() hasIssues = true internalTracker = &api.InternalTracker{ @@ -34,7 +35,7 @@ func getRepoEditOptionFromRepo(repo *models.Repository) *api.EditRepoOption { AllowOnlyContributorsToTrackTime: config.AllowOnlyContributorsToTrackTime, EnableIssueDependencies: config.EnableDependencies, } - } else if unit, err := repo.GetUnit(models.UnitTypeExternalTracker); err == nil { + } else if unit, err := repo.GetUnit(unit_model.TypeExternalTracker); err == nil { config := unit.ExternalTrackerConfig() hasIssues = true externalTracker = &api.ExternalTracker{ @@ -45,9 +46,9 @@ func getRepoEditOptionFromRepo(repo *models.Repository) *api.EditRepoOption { } hasWiki := false var externalWiki *api.ExternalWiki - if _, err := repo.GetUnit(models.UnitTypeWiki); err == nil { + if _, err := repo.GetUnit(unit_model.TypeWiki); err == nil { hasWiki = true - } else if unit, err := repo.GetUnit(models.UnitTypeExternalWiki); err == nil { + } else if unit, err := repo.GetUnit(unit_model.TypeExternalWiki); err == nil { hasWiki = true config := unit.ExternalWikiConfig() externalWiki = &api.ExternalWiki{ @@ -61,7 +62,7 @@ func getRepoEditOptionFromRepo(repo *models.Repository) *api.EditRepoOption { allowRebase := false allowRebaseMerge := false allowSquash := false - if unit, err := repo.GetUnit(models.UnitTypePullRequests); err == nil { + if unit, err := repo.GetUnit(unit_model.TypePullRequests); err == nil { config := unit.PullRequestsConfig() hasPullRequests = true ignoreWhitespaceConflicts = config.IgnoreWhitespaceConflicts |