Skip to content

Commit 1c626b3

Browse files
committed
Addressing review feedback
1 parent 7ee9f21 commit 1c626b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/GitVersionCore/BranchConfigurationCalculator.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ 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, config.Branches[ConfigurationProvider.DevelopBranchKey].Regex, RegexOptions.IgnoreCase)
144-
|| Regex.IsMatch(b.FriendlyName, config.Branches[ConfigurationProvider.MasterBranchKey].Regex, RegexOptions.IgnoreCase));
143+
var developBranchRegex = config.Branches[ConfigurationProvider.DevelopBranchKey].Regex;
144+
var masterBranchRegex = config.Branches[ConfigurationProvider.MasterBranchKey].Regex;
145+
146+
var chosenBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.FriendlyName, developBranchRegex, RegexOptions.IgnoreCase)
147+
|| Regex.IsMatch(b.FriendlyName, masterBranchRegex, RegexOptions.IgnoreCase));
145148
if (chosenBranch == null)
146149
{
147150
// TODO We should call the build server to generate this exception, each build server works differently

0 commit comments

Comments
 (0)