@@ -59,17 +59,17 @@ static BranchConfig InheritBranchConfiguration(GitVersionContext context, Branch
59
59
{
60
60
excludedInheritBranches = repository . Branches . Where ( b =>
61
61
{
62
- var branchConfig = config . GetConfigForBranch ( b . FriendlyName ) ;
62
+ var branchConfig = config . GetConfigForBranch ( b . NameWithoutRemote ( ) ) ;
63
63
64
- return branchConfig != null && branchConfig . Increment == IncrementStrategy . Inherit ;
64
+ return branchConfig == null || branchConfig . Increment == IncrementStrategy . Inherit ;
65
65
} ) . ToList ( ) ;
66
66
}
67
67
// Add new excluded branches.
68
68
foreach ( var excludedBranch in excludedBranches . ExcludingBranches ( excludedInheritBranches ) )
69
69
{
70
70
excludedInheritBranches . Add ( excludedBranch ) ;
71
71
}
72
- var branchesToEvaluate = repository . Branches . Except ( excludedInheritBranches ) . ToList ( ) ;
72
+ var branchesToEvaluate = repository . Branches . ExcludingBranches ( excludedInheritBranches ) . ToList ( ) ;
73
73
74
74
var branchPoint = context . RepositoryMetadataProvider
75
75
. FindCommitBranchWasBranchedFrom ( targetBranch , excludedInheritBranches . ToArray ( ) ) ;
@@ -116,25 +116,6 @@ static BranchConfig InheritBranchConfiguration(GitVersionContext context, Branch
116
116
}
117
117
}
118
118
119
- if ( possibleParents . Count > 1 )
120
- {
121
- // Lets try and get the branch config for each possible parent, the first may not have config
122
- foreach ( var possibleParent in possibleParents )
123
- {
124
- var branchConfig = GetBranchConfiguration ( context , possibleParent , excludedInheritBranches ) ;
125
- if ( branchConfig . Name != FallbackConfigName )
126
- {
127
- return new BranchConfig ( branchConfiguration )
128
- {
129
- Increment = branchConfig . Increment ,
130
- PreventIncrementOfMergedBranchVersion = branchConfig . PreventIncrementOfMergedBranchVersion ,
131
- // If we are inheriting from develop then we should behave like develop
132
- TracksReleaseBranches = branchConfig . TracksReleaseBranches
133
- } ;
134
- }
135
- }
136
- }
137
-
138
119
// If we fail to inherit it is probably because the branch has been merged and we can't do much. So we will fall back to develop's config
139
120
// if develop exists and master if not
140
121
string errorMessage ;
0 commit comments