Skip to content

Commit 7ee9f21

Browse files
committed
Changing hardcoded master/develop regex
1 parent 9c70946 commit 7ee9f21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitVersionCore/BranchConfigurationCalculator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ static BranchConfig InheritBranchConfiguration(GitVersionContext context, Branch
140140
else
141141
errorMessage = "Failed to inherit Increment branch configuration, ended up with: " + string.Join(", ", possibleParents.Select(p => p.FriendlyName));
142142

143-
var chosenBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.FriendlyName, "^develop", RegexOptions.IgnoreCase)
144-
|| Regex.IsMatch(b.FriendlyName, "master$", RegexOptions.IgnoreCase));
143+
var chosenBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.FriendlyName, config.Branches[ConfigurationProvider.DevelopBranchKey].Regex, RegexOptions.IgnoreCase)
144+
|| Regex.IsMatch(b.FriendlyName, config.Branches[ConfigurationProvider.MasterBranchKey].Regex, RegexOptions.IgnoreCase));
145145
if (chosenBranch == null)
146146
{
147147
// TODO We should call the build server to generate this exception, each build server works differently

0 commit comments

Comments
 (0)