Skip to content

Commit

Permalink
(GitToolsGH-2456) Testing stuff out just now
Browse files Browse the repository at this point in the history
Will rebase with proper commit message and tests later.
  • Loading branch information
gep13 committed Feb 1, 2021
1 parent 464c7ce commit 01c1e3b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,23 @@ public SemanticVersion FindVersion()
}

var baseVersion = baseVersionCalculator.GetBaseVersion();
baseVersion.SemanticVersion.BuildMetaData = mainlineVersionCalculator.CreateVersionBuildMetaData(baseVersion.BaseVersionSource);
SemanticVersion semver;
if (context.Configuration.VersioningMode == VersioningMode.Mainline)
{
semver = mainlineVersionCalculator.FindMainlineModeVersion(baseVersion);
}
else
{
semver = PerformIncrement(baseVersion);
semver.BuildMetaData = mainlineVersionCalculator.CreateVersionBuildMetaData(baseVersion.BaseVersionSource);
if (taggedSemanticVersion?.BuildMetaData == null || (taggedSemanticVersion.BuildMetaData.Sha != baseVersion.SemanticVersion.BuildMetaData.Sha))
{
semver = PerformIncrement(baseVersion);
semver.BuildMetaData = mainlineVersionCalculator.CreateVersionBuildMetaData(baseVersion.BaseVersionSource);
}
else
{
semver = baseVersion.SemanticVersion;
}
}

var hasPreReleaseTag = semver.PreReleaseTag.HasTag();
Expand Down

0 comments on commit 01c1e3b

Please sign in to comment.