File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
backend/infrahub/core/branch Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -85,13 +85,18 @@ def validate_branch_name(cls, value: str) -> str:
8585 @model_validator (mode = "after" )
8686 def validate_name (self ) -> Self :
8787 if (
88- not self .sync_with_git
89- and config .SETTINGS .git .sync_branch_names
90- and not branch_name_in_sync_branches (branch_short_name = self .name )
88+ not config .SETTINGS .git .sync_branch_names
89+ or self .name == GLOBAL_BRANCH_NAME
90+ or self .is_default
91+ or self .sync_with_git
9192 ):
93+ return self
94+
95+ if not branch_name_in_sync_branches (branch_short_name = self .name ):
9296 raise ValidationError (
9397 f"Branch name '{ self .name } ' does not match sync branch names { config .SETTINGS .git .sync_branch_names } "
9498 )
99+
95100 return self
96101
97102 @field_validator ("branched_from" , mode = "before" )
You can’t perform that action at this time.
0 commit comments