Skip to content

Commit 9491472

Browse files
authored
Merge branch 'master' into bugfix/1257
2 parents df2bcf7 + 443c994 commit 9491472

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

docs/who.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Various people are actively using GitVersion, and taking advantage of the automa
44
* [Catel](https://github.com/catel/catel)
55
* [ChocolateyGUI](https://github.com/chocolatey/ChocolateyGUI)
66
* [GitLink](https://github.com/GitTools/GitLink)
7+
* [OctopusDeploy](https://github.com/OctopusDeploy)
78
* [Orc.* packages](https://github.com/wildgums?query=orc)
89
* [Orchestra](https://github.com/wildgums/orchestra)
910
* [Pomona](http://pomona.io/)

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
{
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
namespace GitVersion
22
{
3-
using Microsoft.Win32;
3+
using System;
44

55
public class ContinuaCi : BuildServerBase
66
{
7-
public override bool CanApplyToCurrentContext()
8-
{
9-
const string KeyName = @"Software\VSoft Technologies\Continua CI Agent";
107

11-
if (RegistryKeyExists(KeyName, RegistryView.Registry32))
12-
{
13-
return true;
14-
}
8+
public const string EnvironmentVariableName = "ContinuaCI.Version";
159

16-
if (RegistryKeyExists(KeyName, RegistryView.Registry64))
17-
{
18-
return true;
19-
}
10+
public override bool CanApplyToCurrentContext()
11+
{
12+
return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(EnvironmentVariableName));
2013

21-
return false;
2214
}
2315

2416
public override string[] GenerateSetParameterMessage(string name, string value)
@@ -32,14 +24,6 @@ public override string[] GenerateSetParameterMessage(string name, string value)
3224
public override string GenerateSetVersionMessage(VersionVariables variables)
3325
{
3426
return string.Format("@@continua[setBuildVersion value='{0}']", variables.FullSemVer);
35-
}
36-
37-
static bool RegistryKeyExists(string keyName, RegistryView registryView)
38-
{
39-
var localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, registryView);
40-
localKey = localKey.OpenSubKey(keyName);
41-
42-
return localKey != null;
43-
}
27+
}
4428
}
4529
}

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)