Skip to content

Commit

Permalink
change the calls to the CreateNextVersion and replace it with new Nex…
Browse files Browse the repository at this point in the history
…tVersion
  • Loading branch information
HHobeck committed Dec 19, 2023
1 parent f547042 commit dcadb4a
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public virtual NextVersion FindVersion()
var nextVersion = CalculateNextVersion(Context.CurrentBranch, Context.Configuration);
var incrementedVersion = CalculateIncrementedVersion(nextVersion.Configuration.VersioningMode, nextVersion);

return CreateNextVersion(nextVersion.BaseVersion, incrementedVersion, nextVersion.BranchConfiguration);
return new NextVersion(incrementedVersion, nextVersion.BaseVersion, nextVersion.BranchConfiguration);
}

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

log.Info($"Base version used: {calculatedBase}");
log.Separator();
return CreateNextVersion(calculatedBase, maxVersion.IncrementedVersion, maxVersion.BranchConfiguration);
}

private static NextVersion CreateNextVersion(BaseVersion baseVersion, SemanticVersion incrementedVersion, EffectiveBranchConfiguration effectiveBranchConfiguration)
{
incrementedVersion.NotNull();
baseVersion.NotNull();

return new(incrementedVersion, baseVersion, effectiveBranchConfiguration);
return new NextVersion(maxVersion.IncrementedVersion, calculatedBase, maxVersion.BranchConfiguration);
}

private static NextVersion CompareVersions(NextVersion versions1, NextVersion version2)
Expand Down

0 comments on commit dcadb4a

Please sign in to comment.