summaryrefslogtreecommitdiffstats
path: root/modules/doctor
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-10 03:57:58 +0800
committerGitHub <noreply@github.com>2021-11-09 20:57:58 +0100
commit99b2858e628d92bba252be72def409af77af735b (patch)
tree56159cf10b271307911e6f01626c0c3efba789ab /modules/doctor
parentb6b1e716654fec3b16d245ef65cf42e57e1bb5b6 (diff)
downloadgitea-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 'modules/doctor')
-rw-r--r--modules/doctor/fix16961.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/doctor/fix16961.go b/modules/doctor/fix16961.go
index 60cc5ffe2f..e0e44b414b 100644
--- a/modules/doctor/fix16961.go
+++ b/modules/doctor/fix16961.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/timeutil"
"xorm.io/builder"
@@ -212,34 +213,34 @@ func fixBrokenRepoUnit16961(repoUnit *models.RepoUnit, bs []byte) (fixed bool, e
return false, nil
}
- switch models.UnitType(repoUnit.Type) {
- case models.UnitTypeCode, models.UnitTypeReleases, models.UnitTypeWiki, models.UnitTypeProjects:
+ switch unit.Type(repoUnit.Type) {
+ case unit.TypeCode, unit.TypeReleases, unit.TypeWiki, unit.TypeProjects:
cfg := &models.UnitConfig{}
repoUnit.Config = cfg
if fixed, err := fixUnitConfig16961(bs, cfg); !fixed {
return false, err
}
- case models.UnitTypeExternalWiki:
+ case unit.TypeExternalWiki:
cfg := &models.ExternalWikiConfig{}
repoUnit.Config = cfg
if fixed, err := fixExternalWikiConfig16961(bs, cfg); !fixed {
return false, err
}
- case models.UnitTypeExternalTracker:
+ case unit.TypeExternalTracker:
cfg := &models.ExternalTrackerConfig{}
repoUnit.Config = cfg
if fixed, err := fixExternalTrackerConfig16961(bs, cfg); !fixed {
return false, err
}
- case models.UnitTypePullRequests:
+ case unit.TypePullRequests:
cfg := &models.PullRequestsConfig{}
repoUnit.Config = cfg
if fixed, err := fixPullRequestsConfig16961(bs, cfg); !fixed {
return false, err
}
- case models.UnitTypeIssues:
+ case unit.TypeIssues:
cfg := &models.IssuesConfig{}
repoUnit.Config = cfg
if fixed, err := fixIssuesConfig16961(bs, cfg); !fixed {
@@ -256,7 +257,7 @@ func fixBrokenRepoUnits16961(logger log.Logger, autofix bool) error {
type RepoUnit struct {
ID int64
RepoID int64
- Type models.UnitType
+ Type unit.Type
Config []byte
CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED"`
}