Skip to content

Commit

Permalink
Fix SemVer.ToString to handle v0 case (#20665)
Browse files Browse the repository at this point in the history
Since we are treating v0 versions as prerelease we need to make sure
we don't accidently start to add the bogus prerelease label in cases where
we call ToString() on the version.

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
  • Loading branch information
2 people authored and iscai-msft committed Sep 29, 2021
1 parent f7569bd commit 24d070a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eng/common/scripts/SemVer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class AzureEngSemanticVersion : IComparable {
{
$versionString = "{0}.{1}.{2}" -F $this.Major, $this.Minor, $this.Patch

if ($this.IsPrerelease)
if ($this.IsPrerelease -and $this.PrereleaseLabel -ne "zzz")
{
$versionString += $this.PrereleaseLabelSeparator + $this.PrereleaseLabel + `
$this.PrereleaseNumberSeparator + $this.PrereleaseNumber
Expand Down

0 comments on commit 24d070a

Please sign in to comment.