diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs b/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs index 006d39326c..84474d4418 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs +++ b/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs @@ -164,6 +164,44 @@ public void CanProvideConfigForNewBranch() config.Branches["bug"].Tag.ShouldBe("bugfix"); } + [Test] + public void MasterConfigReplacedWithMain() + { + const string text = @" +next-version: 2.0.0 +branches: + master: + regex: '^master$|^main$' + tag: beta"; + SetupConfigFileContent(text); + + var config = configProvider.Provide(repoPath); + + config.Branches[MainBranch].Regex.ShouldBe("^master$|^main$"); + config.Branches[MainBranch].Tag.ShouldBe("beta"); + } + + [Test] + public void MasterConfigReplacedWithMainInSourceBranches() + { + const string text = @" +next-version: 2.0.0 +branches: + breaking: + regex: breaking[/] + mode: ContinuousDeployment + increment: Major + source-branches: ['master'] + is-release-branch: false"; + SetupConfigFileContent(text); + + var config = configProvider.Provide(repoPath); + + config.Branches["breaking"].Regex.ShouldBe("breaking[/]"); + config.Branches["breaking"].SourceBranches.ShouldHaveSingleItem(); + config.Branches["breaking"].SourceBranches.ShouldContain(MainBranch); + } + [Test] public void NextVersionCanBeInteger() {