@@ -40,7 +40,7 @@ public VersionField DetermineIncrementedField(
4040 configuration . NotNull ( ) ;
4141
4242 var commitMessageIncrement = FindCommitMessageIncrement (
43- configuration , baseVersion , currentCommit , label ) ;
43+ configuration , baseVersion . BaseVersionSource , currentCommit , label ) ;
4444
4545 var defaultIncrement = configuration . Increment . ToVersionField ( ) ;
4646
@@ -81,38 +81,31 @@ public VersionField DetermineIncrementedField(
8181 }
8282
8383 private VersionField ? FindCommitMessageIncrement (
84- EffectiveConfiguration configuration , BaseVersion baseVersion , ICommit ? currentCommit , string ? label )
84+ EffectiveConfiguration configuration , ICommit ? baseCommit , ICommit ? currentCommit , string ? label )
8585 {
8686 if ( configuration . CommitMessageIncrementing == CommitMessageIncrementMode . Disabled )
8787 {
8888 return null ;
8989 }
9090
91- var baseCommit = baseVersion . BaseVersionSource ;
92-
9391 //get tags with valid version - depends on configuration (see #3757)
9492 var targetShas = new Lazy < IReadOnlySet < string > > ( ( ) =>
9593 this . taggedSemanticVersionRepository . GetTaggedSemanticVersions ( configuration . TagPrefix , configuration . SemanticVersionFormat )
96- . SelectMany ( _ => _ ) . Where ( _ => _ . Value . IsMatchForBranchSpecificLabel ( label ) ) . Select ( _ => _ . Tag . TargetSha ) . ToHashSet ( )
94+ . SelectMany ( _ => _ ) . Where ( _ => _ . Value . IsMatchForBranchSpecificLabel ( label ) ) . Select ( _ => _ . Tag . TargetSha ) . ToHashSet ( )
9795 ) ;
9896
99- var targetTags = this . taggedSemanticVersionRepository
100- . GetTaggedSemanticVersions ( configuration . TagPrefix , configuration . SemanticVersionFormat )
101- . SelectMany ( _ => _ ) . Where ( element => element . Value . IsMatchForBranchSpecificLabel ( label )
102- && element . Value . CompareTo ( baseVersion . GetSemanticVersion ( ) ) == 0 ) . Select ( _ => _ . Tag . TargetSha ) . ToHashSet ( ) ;
103-
104- var intermediateCommits = GetIntermediateCommits ( baseCommit , currentCommit ) ;
97+ var commits = GetIntermediateCommits ( baseCommit , currentCommit ) ;
10598 // consider commit messages since latest tag only (see #3071)
106- var commits = intermediateCommits
99+ commits = commits
107100 . Reverse ( )
108- . TakeWhile ( x => baseCommit != x )
109- . Where ( element => ! targetShas . Value . Contains ( element . Sha ) )
101+ . TakeWhile ( x => ! targetShas . Value . Contains ( x . Sha ) )
110102 . Reverse ( ) ;
111103
112104 if ( configuration . CommitMessageIncrementing == CommitMessageIncrementMode . MergeMessageOnly )
113105 {
114106 commits = commits . Where ( c => c . Parents . Count ( ) > 1 ) ;
115107 }
108+
116109 return GetIncrementForCommits (
117110 majorVersionBumpMessage : configuration . MajorVersionBumpMessage ,
118111 minorVersionBumpMessage : configuration . MinorVersionBumpMessage ,
0 commit comments