@@ -14,7 +14,8 @@ public class NextVersionCalculator : INextVersionCalculator
1414 private readonly IRepositoryStore repositoryStore ;
1515 private readonly IIncrementStrategyFinder incrementStrategyFinder ;
1616 private readonly Lazy < GitVersionContext > versionContext ;
17- private GitVersionContext context => this . versionContext . Value ;
17+
18+ private GitVersionContext Context => this . versionContext . Value ;
1819
1920 public NextVersionCalculator (
2021 ILog log ,
@@ -34,32 +35,32 @@ public NextVersionCalculator(
3435
3536 public NextVersion FindVersion ( )
3637 {
37- this . log . Info ( $ "Running against branch: { context . CurrentBranch } ({ context . CurrentCommit ? . ToString ( ) ?? "-" } )") ;
38- if ( context . IsCurrentCommitTagged )
38+ this . log . Info ( $ "Running against branch: { Context . CurrentBranch } ({ Context . CurrentCommit ? . ToString ( ) ?? "-" } )") ;
39+ if ( Context . IsCurrentCommitTagged )
3940 {
40- this . log . Info ( $ "Current commit is tagged with version { context . CurrentCommitTaggedVersion } , " + "version calculation is for metadata only." ) ;
41+ this . log . Info ( $ "Current commit is tagged with version { Context . CurrentCommitTaggedVersion } , " + "version calculation is for metadata only." ) ;
4142 }
4243 else
4344 {
44- EnsureHeadIsNotDetached ( context ) ;
45+ EnsureHeadIsNotDetached ( Context ) ;
4546 }
4647
4748 SemanticVersion ? taggedSemanticVersion = null ;
4849
49- if ( context . IsCurrentCommitTagged )
50+ if ( Context . IsCurrentCommitTagged )
5051 {
5152 // Will always be 0, don't bother with the +0 on tags
52- var semanticVersionBuildMetaData = this . mainlineVersionCalculator . CreateVersionBuildMetaData ( context . CurrentCommit ) ;
53+ var semanticVersionBuildMetaData = this . mainlineVersionCalculator . CreateVersionBuildMetaData ( Context . CurrentCommit ) ;
5354 semanticVersionBuildMetaData . CommitsSinceTag = null ;
5455
55- var semanticVersion = new SemanticVersion ( context . CurrentCommitTaggedVersion ) { BuildMetaData = semanticVersionBuildMetaData } ;
56+ var semanticVersion = new SemanticVersion ( Context . CurrentCommitTaggedVersion ) { BuildMetaData = semanticVersionBuildMetaData } ;
5657 taggedSemanticVersion = semanticVersion ;
5758 }
5859
5960 var ( baseVersion , configuration ) = this . baseVersionCalculator . GetBaseVersion ( ) ;
6061 baseVersion . SemanticVersion . BuildMetaData = this . mainlineVersionCalculator . CreateVersionBuildMetaData ( baseVersion . BaseVersionSource ) ;
6162 SemanticVersion semver ;
62- if ( context . FullConfiguration . VersioningMode == VersioningMode . Mainline )
63+ if ( Context . FullConfiguration . VersioningMode == VersioningMode . Mainline )
6364 {
6465 semver = this . mainlineVersionCalculator . FindMainlineModeVersion ( baseVersion ) ;
6566 }
@@ -106,19 +107,19 @@ public NextVersion FindVersion()
106107 private SemanticVersion PerformIncrement ( BaseVersion baseVersion , EffectiveConfiguration configuration )
107108 {
108109 var semver = baseVersion . SemanticVersion ;
109- var increment = this . incrementStrategyFinder . DetermineIncrementedField ( context , baseVersion , configuration ) ;
110+ var increment = this . incrementStrategyFinder . DetermineIncrementedField ( Context , baseVersion , configuration ) ;
110111 semver = semver . IncrementVersion ( increment ) ;
111112 return semver ;
112113 }
113114
114115 private void UpdatePreReleaseTag ( EffectiveConfiguration configuration , SemanticVersion semanticVersion , string ? branchNameOverride )
115116 {
116- var tagToUse = configuration . GetBranchSpecificTag ( this . log , context . CurrentBranch . Name . Friendly , branchNameOverride ) ;
117+ var tagToUse = configuration . GetBranchSpecificTag ( this . log , Context . CurrentBranch . Name . Friendly , branchNameOverride ) ;
117118
118119 long ? number = null ;
119120
120121 var lastTag = this . repositoryStore
121- . GetVersionTagsOnBranch ( context . CurrentBranch , context . FullConfiguration . TagPrefix )
122+ . GetVersionTagsOnBranch ( Context . CurrentBranch , Context . FullConfiguration . TagPrefix )
122123 . FirstOrDefault ( v => v . PreReleaseTag ? . Name ? . IsEquivalentTo ( tagToUse ) == true ) ;
123124
124125 if ( lastTag != null && MajorMinorPatchEqual ( lastTag , semanticVersion ) && lastTag . PreReleaseTag ? . HasTag ( ) == true )
0 commit comments