File tree 1 file changed +6
-1
lines changed 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ func LoadUnitConfig() {
154
154
DisabledRepoUnits = FindUnitTypes (setting .Repository .DisabledRepoUnits ... )
155
155
// Check that must units are not disabled
156
156
for i , disabledU := range DisabledRepoUnits {
157
- if ! disabledU .CanDisable () {
157
+ if ! disabledU .CanDisable () || disabledU . IsInvalid () {
158
158
log .Warn ("Not allowed to global disable unit %s" , disabledU .String ())
159
159
DisabledRepoUnits = append (DisabledRepoUnits [:i ], DisabledRepoUnits [i + 1 :]... )
160
160
}
@@ -176,6 +176,11 @@ func (u Type) UnitGlobalDisabled() bool {
176
176
return false
177
177
}
178
178
179
+ // IsInvalid checks if this unit type is invalid.
180
+ func (u * Type ) IsInvalid () bool {
181
+ return * u == TypeInvalid
182
+ }
183
+
179
184
// CanDisable checks if this unit type can be disabled.
180
185
func (u * Type ) CanDisable () bool {
181
186
for _ , mu := range MustRepoUnits {
You can’t perform that action at this time.
0 commit comments