Skip to content

Commit 972fcb6

Browse files
authored
Merge pull request #1273 from tgbarnett/MasterBranchNotPrefix
Allow branch names starting with master
2 parents c8332ef + deda26f commit 972fcb6

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/GitVersionCore.Tests/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ branches:
2929
increment: Patch
3030
prevent-increment-of-merged-branch-version: true
3131
track-merge-target: false
32-
regex: master
32+
regex: master$
3333
source-branches:
3434
- develop
3535
- release

src/GitVersionCore.Tests/IntegrationTests/OtherScenarios.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ public void AllowNotHavingMaster()
4646
}
4747
}
4848

49+
[Test]
50+
public void AllowHavingVariantsStartingWithMaster()
51+
{
52+
using (var fixture = new EmptyRepositoryFixture())
53+
{
54+
fixture.Repository.MakeACommit();
55+
fixture.Repository.MakeATaggedCommit("1.0.0");
56+
fixture.Repository.MakeACommit();
57+
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("masterfix"));
58+
59+
fixture.AssertFullSemver("1.0.1-masterfix.1+1");
60+
}
61+
}
62+
4963
[Test]
5064
public void AllowHavingMainInsteadOfMaster()
5165
{

src/GitVersionCore/Configuration/ConfigurationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ConfigurationProvider
2121
public const string HotfixBranchRegex = "hotfix(es)?[/-]";
2222
public const string SupportBranchRegex = "support[/-]";
2323
public const string DevelopBranchRegex = "dev(elop)?(ment)?$";
24-
public const string MasterBranchRegex = "master";
24+
public const string MasterBranchRegex = "master$";
2525
public const string MasterBranchKey = "master";
2626
public const string ReleaseBranchKey = "release";
2727
public const string FeatureBranchKey = "feature";

0 commit comments

Comments
 (0)