Skip to content

Commit c13c113

Browse files
committed
move beta bumping code
1 parent 3fad05e commit c13c113

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

GitVersionCore/GitHubFlow/NextSemverCalculator.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,8 @@ public SemanticVersion NextVersion()
3838
{
3939
versions.Add(tryGetVersion);
4040
}
41+
4142
var otherBranchVersion = unknownBranchFinder.FindVersion(context);
42-
if (otherBranchVersion != null)
43-
{
44-
if (otherBranchVersion.PreReleaseTag != null && otherBranchVersion.PreReleaseTag.Name == "release")
45-
{
46-
otherBranchVersion.PreReleaseTag.Name = "beta";
47-
}
48-
}
4943
versions.Add(otherBranchVersion);
5044

5145
var maxCalculated = versions.Max();

GitVersionCore/GitHubFlow/OtherBranchVersionFinder.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public SemanticVersion FindVersion(GitVersionContext context)
1414
}
1515
var shortVersion = ShortVersionParser.Parse(versionString);
1616

17-
var semanticVersionPreReleaseTag = context.CurrentBranch.Name.Replace("-" + versionString, string.Empty) + ".1";
17+
SemanticVersionPreReleaseTag semanticVersionPreReleaseTag = context.CurrentBranch.Name.Replace("-" + versionString, string.Empty) + ".1";
1818

1919
var nbHotfixCommits = BranchCommitDifferenceFinder.NumberOfCommitsInBranchNotKnownFromBaseBranch(context.Repository, context.CurrentBranch, BranchType.Unknown, "master");
2020

@@ -24,6 +24,11 @@ public SemanticVersion FindVersion(GitVersionContext context)
2424
semanticVersionPreReleaseTag = tagVersion;
2525
}
2626

27+
if (semanticVersionPreReleaseTag.Name == "release")
28+
{
29+
semanticVersionPreReleaseTag.Name = "beta";
30+
}
31+
2732
return new SemanticVersion
2833
{
2934
Major = shortVersion.Major,

0 commit comments

Comments
 (0)