Skip to content

Commit bd005b7

Browse files
rcknightJakeGinnivan
authored andcommitted
Make develop match work more like config matching
1 parent 3ef0185 commit bd005b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

GitVersionCore/BranchConfigurationCalculator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ static KeyValuePair<string, BranchConfig> InheritBranchConfiguration(bool onlyEv
117117
else
118118
errorMessage = "Failed to inherit Increment branch configuration, ended up with: " + string.Join(", ", possibleParents.Select(p => p.Name));
119119

120-
var hasDevelop = repository.Branches["develop"] != null;
121-
var branchName = hasDevelop ? "develop" : "master";
120+
var developBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.Name, "^develop", RegexOptions.IgnoreCase));
121+
var branchName = developBranch != null ? developBranch.Name : "master";
122122

123123
Logger.WriteWarning(errorMessage + Environment.NewLine + Environment.NewLine + "Falling back to " + branchName + " branch config");
124124
var value = GetBranchConfiguration(currentCommit, repository, onlyEvaluateTrackedBranches, config, repository.Branches[branchName]).Value;

0 commit comments

Comments
 (0)