Skip to content

Commit b4152e9

Browse files
committed
Because we allow remote branches to be searched, we need to lookup config without the remote name
1 parent c0ecaf0 commit b4152e9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/GitVersionCore/BranchConfigurationCalculator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class BranchConfigurationCalculator
1515
/// </summary>
1616
public static BranchConfig GetBranchConfiguration(GitVersionContext context, Branch targetBranch, IList<Branch> excludedInheritBranches = null)
1717
{
18-
var matchingBranches = context.FullConfiguration.GetConfigForBranch(targetBranch.FriendlyName);
18+
var matchingBranches = context.FullConfiguration.GetConfigForBranch(targetBranch.NameWithoutRemote());
1919

2020
if (matchingBranches == null)
2121
{

src/GitVersionCore/GitRepoMetadataProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ List<BranchCommit> GetMergeCommitsForBranch(Branch branch, Branch[] excludedBran
225225
return mergeBaseCommitsCache[branch];
226226
}
227227

228-
var currentBranchConfig = configuration.GetConfigForBranch(branch.FriendlyName);
228+
var currentBranchConfig = configuration.GetConfigForBranch(branch.NameWithoutRemote());
229229
var regexesToCheck = currentBranchConfig == null
230230
? new [] { ".*" } // Match anything if we can't find a branch config
231231
: currentBranchConfig.SourceBranches.Select(sb => configuration.Branches[sb].Regex);

src/GitVersionCore/IncrementStrategyFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private static Regex CreateRegex(string pattern)
129129

130130
public static VersionField FindDefaultIncrementForBranch( GitVersionContext context, string branch = null )
131131
{
132-
var config = context.FullConfiguration.GetConfigForBranch(branch ?? context.CurrentBranch.FriendlyName);
132+
var config = context.FullConfiguration.GetConfigForBranch(branch ?? context.CurrentBranch.NameWithoutRemote());
133133
if ( config?.Increment != null && config.Increment != IncrementStrategy.Inherit )
134134
{
135135
return config.Increment.Value.ToVersionField();

0 commit comments

Comments
 (0)