@@ -9,17 +9,20 @@ namespace GitVersion.Configuration;
99/// </summary>
1010public class EffectiveConfiguration
1111{
12- public EffectiveConfiguration ( GitVersionConfiguration configuration , BranchConfiguration currentBranchConfig )
12+ public EffectiveConfiguration ( GitVersionConfiguration configuration , BranchConfiguration branchConfiguration )
1313 {
1414 configuration . NotNull ( ) ;
15- currentBranchConfig . NotNull ( ) ;
15+ branchConfiguration . NotNull ( ) ;
1616
17- var name = currentBranchConfig . Name ;
17+ var fallbackBranchConfiguration = configuration . GetFallbackBranchConfiguration ( ) ;
18+ branchConfiguration = branchConfiguration . Inherit ( fallbackBranchConfiguration ) ;
1819
19- if ( ! currentBranchConfig . VersioningMode . HasValue )
20+ var name = branchConfiguration . Name ;
21+
22+ if ( ! branchConfiguration . VersioningMode . HasValue )
2023 throw new Exception ( $ "Configuration value for 'Versioning mode' for branch { name } has no value. (this should not happen, please report an issue)") ;
2124
22- if ( ! currentBranchConfig . Increment . HasValue )
25+ if ( ! branchConfiguration . Increment . HasValue )
2326 throw new Exception ( $ "Configuration value for 'Increment' for branch { name } has no value. (this should not happen, please report an issue)") ;
2427
2528 if ( ! configuration . AssemblyVersioningScheme . HasValue )
@@ -28,7 +31,7 @@ public EffectiveConfiguration(GitVersionConfiguration configuration, BranchConfi
2831 if ( ! configuration . AssemblyFileVersioningScheme . HasValue )
2932 throw new Exception ( "Configuration value for 'AssemblyFileVersioningScheme' has no value. (this should not happen, please report an issue)" ) ;
3033
31- if ( ! currentBranchConfig . CommitMessageIncrementing . HasValue )
34+ if ( ! branchConfiguration . CommitMessageIncrementing . HasValue )
3235 throw new Exception ( "Configuration value for 'CommitMessageIncrementing' has no value. (this should not happen, please report an issue)" ) ;
3336
3437 if ( ! configuration . LabelPreReleaseWeight . HasValue )
@@ -39,29 +42,29 @@ public EffectiveConfiguration(GitVersionConfiguration configuration, BranchConfi
3942 AssemblyInformationalFormat = configuration . AssemblyInformationalFormat ;
4043 AssemblyVersioningFormat = configuration . AssemblyVersioningFormat ;
4144 AssemblyFileVersioningFormat = configuration . AssemblyFileVersioningFormat ;
42- VersioningMode = currentBranchConfig . VersioningMode . Value ;
45+ VersioningMode = branchConfiguration . VersioningMode . Value ;
4346 LabelPrefix = configuration . LabelPrefix ;
44- Label = currentBranchConfig . Label ?? string . Empty ;
47+ Label = branchConfiguration . Label ?? string . Empty ;
4548 NextVersion = configuration . NextVersion ;
46- Increment = currentBranchConfig . Increment . Value ;
47- BranchPrefixToTrim = currentBranchConfig . Regex ;
48- PreventIncrementOfMergedBranchVersion = currentBranchConfig . PreventIncrementOfMergedBranchVersion ?? false ;
49- LabelNumberPattern = currentBranchConfig . LabelNumberPattern ;
50- TrackMergeTarget = currentBranchConfig . TrackMergeTarget ?? false ;
51- TrackMergeMessage = currentBranchConfig . TrackMergeMessage ?? true ;
49+ Increment = branchConfiguration . Increment . Value ;
50+ BranchPrefixToTrim = branchConfiguration . Regex ;
51+ PreventIncrementOfMergedBranchVersion = branchConfiguration . PreventIncrementOfMergedBranchVersion ?? false ;
52+ LabelNumberPattern = branchConfiguration . LabelNumberPattern ;
53+ TrackMergeTarget = branchConfiguration . TrackMergeTarget ?? false ;
54+ TrackMergeMessage = branchConfiguration . TrackMergeMessage ?? true ;
5255 MajorVersionBumpMessage = configuration . MajorVersionBumpMessage ;
5356 MinorVersionBumpMessage = configuration . MinorVersionBumpMessage ;
5457 PatchVersionBumpMessage = configuration . PatchVersionBumpMessage ;
5558 NoBumpMessage = configuration . NoBumpMessage ;
56- CommitMessageIncrementing = currentBranchConfig . CommitMessageIncrementing . Value ;
59+ CommitMessageIncrementing = branchConfiguration . CommitMessageIncrementing . Value ;
5760 VersionFilters = configuration . Ignore . ToFilters ( ) ;
58- TracksReleaseBranches = currentBranchConfig . TracksReleaseBranches ?? false ;
59- IsReleaseBranch = currentBranchConfig . IsReleaseBranch ?? false ;
60- IsMainline = currentBranchConfig . IsMainline ?? false ;
61+ TracksReleaseBranches = branchConfiguration . TracksReleaseBranches ?? false ;
62+ IsReleaseBranch = branchConfiguration . IsReleaseBranch ?? false ;
63+ IsMainline = branchConfiguration . IsMainline ?? false ;
6164 CommitDateFormat = configuration . CommitDateFormat ;
6265 UpdateBuildNumber = configuration . UpdateBuildNumber ;
6366 SemanticVersionFormat = configuration . SemanticVersionFormat ;
64- PreReleaseWeight = currentBranchConfig . PreReleaseWeight ?? 0 ;
67+ PreReleaseWeight = branchConfiguration . PreReleaseWeight ?? 0 ;
6568 LabelPreReleaseWeight = configuration . LabelPreReleaseWeight . Value ;
6669 }
6770
@@ -174,7 +177,7 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche
174177
175178 public bool UpdateBuildNumber { get ; }
176179
177- public SemanticVersionFormat SemanticVersionFormat { get ; set ; } = SemanticVersionFormat . Strict ;
180+ public SemanticVersionFormat SemanticVersionFormat { get ; set ; }
178181
179182 public int PreReleaseWeight { get ; }
180183
0 commit comments