Skip to content

Commit dcadb4a

Browse files
committed
change the calls to the CreateNextVersion and replace it with new NextVersion
1 parent f547042 commit dcadb4a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public virtual NextVersion FindVersion()
4343
var nextVersion = CalculateNextVersion(Context.CurrentBranch, Context.Configuration);
4444
var incrementedVersion = CalculateIncrementedVersion(nextVersion.Configuration.VersioningMode, nextVersion);
4545

46-
return CreateNextVersion(nextVersion.BaseVersion, incrementedVersion, nextVersion.BranchConfiguration);
46+
return new NextVersion(incrementedVersion, nextVersion.BaseVersion, nextVersion.BranchConfiguration);
4747
}
4848

4949
private SemanticVersion CalculateIncrementedVersion(VersioningMode versioningMode, NextVersion nextVersion)
@@ -114,15 +114,8 @@ private NextVersion CalculateNextVersion(IBranch branch, IGitVersionConfiguratio
114114

115115
log.Info($"Base version used: {calculatedBase}");
116116
log.Separator();
117-
return CreateNextVersion(calculatedBase, maxVersion.IncrementedVersion, maxVersion.BranchConfiguration);
118-
}
119-
120-
private static NextVersion CreateNextVersion(BaseVersion baseVersion, SemanticVersion incrementedVersion, EffectiveBranchConfiguration effectiveBranchConfiguration)
121-
{
122-
incrementedVersion.NotNull();
123-
baseVersion.NotNull();
124117

125-
return new(incrementedVersion, baseVersion, effectiveBranchConfiguration);
118+
return new NextVersion(maxVersion.IncrementedVersion, calculatedBase, maxVersion.BranchConfiguration);
126119
}
127120

128121
private static NextVersion CompareVersions(NextVersion versions1, NextVersion version2)

0 commit comments

Comments
 (0)