diff --git a/src/GitVersionCore.Tests/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt b/src/GitVersionCore.Tests/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt index 3ad3bf8f76..1a0c0ba54b 100644 --- a/src/GitVersionCore.Tests/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt +++ b/src/GitVersionCore.Tests/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt @@ -29,7 +29,7 @@ branches: increment: Patch prevent-increment-of-merged-branch-version: true track-merge-target: false - regex: master + regex: master$ source-branches: - develop - release diff --git a/src/GitVersionCore.Tests/IntegrationTests/OtherScenarios.cs b/src/GitVersionCore.Tests/IntegrationTests/OtherScenarios.cs index 4ebda3317b..5fef1447c6 100644 --- a/src/GitVersionCore.Tests/IntegrationTests/OtherScenarios.cs +++ b/src/GitVersionCore.Tests/IntegrationTests/OtherScenarios.cs @@ -46,6 +46,20 @@ public void AllowNotHavingMaster() } } + [Test] + public void AllowHavingVariantsStartingWithMaster() + { + using (var fixture = new EmptyRepositoryFixture()) + { + fixture.Repository.MakeACommit(); + fixture.Repository.MakeATaggedCommit("1.0.0"); + fixture.Repository.MakeACommit(); + Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("masterfix")); + + fixture.AssertFullSemver("1.0.1-masterfix.1+1"); + } + } + [Test] public void AllowHavingMainInsteadOfMaster() { diff --git a/src/GitVersionCore/Configuration/ConfigurationProvider.cs b/src/GitVersionCore/Configuration/ConfigurationProvider.cs index 89eaa9474e..1c9a98e71d 100644 --- a/src/GitVersionCore/Configuration/ConfigurationProvider.cs +++ b/src/GitVersionCore/Configuration/ConfigurationProvider.cs @@ -21,7 +21,7 @@ public class ConfigurationProvider public const string HotfixBranchRegex = "hotfix(es)?[/-]"; public const string SupportBranchRegex = "support[/-]"; public const string DevelopBranchRegex = "dev(elop)?(ment)?$"; - public const string MasterBranchRegex = "master"; + public const string MasterBranchRegex = "master$"; public const string MasterBranchKey = "master"; public const string ReleaseBranchKey = "release"; public const string FeatureBranchKey = "feature";