File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
src/GitVersion.Core.Tests/Configuration Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,44 @@ public void CanProvideConfigForNewBranch()
164164 config . Branches [ "bug" ] . Tag . ShouldBe ( "bugfix" ) ;
165165 }
166166
167+ [ Test ]
168+ public void MasterConfigReplacedWithMain ( )
169+ {
170+ const string text = @"
171+ next-version: 2.0.0
172+ branches:
173+ master:
174+ regex: '^master$|^main$'
175+ tag: beta" ;
176+ SetupConfigFileContent ( text ) ;
177+
178+ var config = configProvider . Provide ( repoPath ) ;
179+
180+ config . Branches [ MainBranch ] . Regex . ShouldBe ( "^master$|^main$" ) ;
181+ config . Branches [ MainBranch ] . Tag . ShouldBe ( "beta" ) ;
182+ }
183+
184+ [ Test ]
185+ public void MasterConfigReplacedWithMainInSourceBranches ( )
186+ {
187+ const string text = @"
188+ next-version: 2.0.0
189+ branches:
190+ breaking:
191+ regex: breaking[/]
192+ mode: ContinuousDeployment
193+ increment: Major
194+ source-branches: ['master']
195+ is-release-branch: false" ;
196+ SetupConfigFileContent ( text ) ;
197+
198+ var config = configProvider . Provide ( repoPath ) ;
199+
200+ config . Branches [ "breaking" ] . Regex . ShouldBe ( "breaking[/]" ) ;
201+ config . Branches [ "breaking" ] . SourceBranches . ShouldHaveSingleItem ( ) ;
202+ config . Branches [ "breaking" ] . SourceBranches . ShouldContain ( MainBranch ) ;
203+ }
204+
167205 [ Test ]
168206 public void NextVersionCanBeInteger ( )
169207 {
You can’t perform that action at this time.
0 commit comments