@@ -40,7 +40,7 @@ public VersionField DetermineIncrementedField(
40
40
configuration . NotNull ( ) ;
41
41
42
42
var commitMessageIncrement = FindCommitMessageIncrement (
43
- configuration , baseVersion , currentCommit , label ) ;
43
+ configuration , baseVersion . BaseVersionSource , currentCommit , label ) ;
44
44
45
45
var defaultIncrement = configuration . Increment . ToVersionField ( ) ;
46
46
@@ -81,38 +81,31 @@ public VersionField DetermineIncrementedField(
81
81
}
82
82
83
83
private VersionField ? FindCommitMessageIncrement (
84
- EffectiveConfiguration configuration , BaseVersion baseVersion , ICommit ? currentCommit , string ? label )
84
+ EffectiveConfiguration configuration , ICommit ? baseCommit , ICommit ? currentCommit , string ? label )
85
85
{
86
86
if ( configuration . CommitMessageIncrementing == CommitMessageIncrementMode . Disabled )
87
87
{
88
88
return null ;
89
89
}
90
90
91
- var baseCommit = baseVersion . BaseVersionSource ;
92
-
93
91
//get tags with valid version - depends on configuration (see #3757)
94
92
var targetShas = new Lazy < IReadOnlySet < string > > ( ( ) =>
95
93
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 ( )
97
95
) ;
98
96
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 ) ;
105
98
// consider commit messages since latest tag only (see #3071)
106
- var commits = intermediateCommits
99
+ commits = commits
107
100
. Reverse ( )
108
- . TakeWhile ( x => baseCommit != x )
109
- . Where ( element => ! targetShas . Value . Contains ( element . Sha ) )
101
+ . TakeWhile ( x => ! targetShas . Value . Contains ( x . Sha ) )
110
102
. Reverse ( ) ;
111
103
112
104
if ( configuration . CommitMessageIncrementing == CommitMessageIncrementMode . MergeMessageOnly )
113
105
{
114
106
commits = commits . Where ( c => c . Parents . Count ( ) > 1 ) ;
115
107
}
108
+
116
109
return GetIncrementForCommits (
117
110
majorVersionBumpMessage : configuration . MajorVersionBumpMessage ,
118
111
minorVersionBumpMessage : configuration . MinorVersionBumpMessage ,
0 commit comments