@@ -14,7 +14,6 @@ import (
1414 "code.gitea.io/gitea/modules/container"
1515 "code.gitea.io/gitea/modules/log"
1616 "code.gitea.io/gitea/modules/setting"
17- "code.gitea.io/gitea/modules/util"
1817)
1918
2019// Type is Unit's Type
@@ -35,10 +34,6 @@ const (
3534 TypePackages // 9 Packages
3635 TypeActions // 10 Actions
3736
38- // misc is a special uint to store special configs for a repo which is not related to any unit,
39- // it should be considered as enabled anyway
40- TypeMisc Type = 999 // 999 misc
41-
4237 // FIXME: TEAM-UNIT-PERMISSION: the team unit "admin" permission's design is not right, when a new unit is added in the future,
4338 // admin team won't inherit the correct admin permission for the new unit, need to have a complete fix before adding any new unit.
4439)
7065 TypeProjects ,
7166 TypePackages ,
7267 TypeActions ,
73- TypeMisc ,
7468 }
7569
7670 // DefaultRepoUnits contains the default unit types
@@ -83,14 +77,12 @@ var (
8377 TypeProjects ,
8478 TypePackages ,
8579 TypeActions ,
86- TypeMisc ,
8780 }
8881
8982 // ForkRepoUnits contains the default unit types for forks
9083 DefaultForkRepoUnits = []Type {
9184 TypeCode ,
9285 TypePullRequests ,
93- TypeMisc ,
9486 }
9587
9688 // DefaultMirrorRepoUnits contains the default unit types for mirrors
10193 TypeWiki ,
10294 TypeProjects ,
10395 TypePackages ,
104- TypeMisc ,
10596 }
10697
10798 // DefaultTemplateRepoUnits contains the default unit types for templates
@@ -113,14 +104,12 @@ var (
113104 TypeWiki ,
114105 TypeProjects ,
115106 TypePackages ,
116- TypeMisc ,
117107 }
118108
119109 // NotAllowedDefaultRepoUnits contains units that can't be default
120110 NotAllowedDefaultRepoUnits = []Type {
121111 TypeExternalWiki ,
122112 TypeExternalTracker ,
123- TypeMisc ,
124113 }
125114
126115 disabledRepoUnitsAtomic atomic.Pointer [[]Type ] // the units that have been globally disabled
@@ -174,11 +163,6 @@ func LoadUnitConfig() error {
174163 if len (invalidKeys ) > 0 {
175164 log .Warn ("Invalid keys in disabled repo units: %s" , strings .Join (invalidKeys , ", " ))
176165 }
177- if slices .Contains (disabledRepoUnits , TypeMisc ) {
178- log .Warn ("Misc unit should not be disabled" )
179- disabledRepoUnits = util .SliceRemoveAll (disabledRepoUnits , TypeMisc )
180- }
181-
182166 DisabledRepoUnitsSet (disabledRepoUnits )
183167
184168 setDefaultRepoUnits , invalidKeys := FindUnitTypes (setting .Repository .DefaultRepoUnits ... )
@@ -344,15 +328,6 @@ var (
344328 perm .AccessModeOwner ,
345329 }
346330
347- UnitMisc = Unit {
348- TypeMisc ,
349- "repo.misc" ,
350- "/misc" ,
351- "misc.unit.desc" ,
352- 999 ,
353- perm .AccessModeOwner ,
354- }
355-
356331 // Units contains all the units
357332 Units = map [Type ]Unit {
358333 TypeCode : UnitCode ,
@@ -365,7 +340,6 @@ var (
365340 TypeProjects : UnitProjects ,
366341 TypePackages : UnitPackages ,
367342 TypeActions : UnitActions ,
368- TypeMisc : UnitMisc ,
369343 }
370344)
371345
0 commit comments