Skip to content

Commit 79b6f6d

Browse files
committed
Remove unused IncrementVersion method in SemanticVersion.
1 parent fd60d32 commit 79b6f6d

File tree

2 files changed

+0
-59
lines changed

2 files changed

+0
-59
lines changed

src/GitVersion.Core/PublicAPI.Unshipped.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ GitVersion.SemanticVersion.IncrementMode
553553
GitVersion.SemanticVersion.IncrementMode.EnsureIntegrity = 2 -> GitVersion.SemanticVersion.IncrementMode
554554
GitVersion.SemanticVersion.IncrementMode.Force = 1 -> GitVersion.SemanticVersion.IncrementMode
555555
GitVersion.SemanticVersion.IncrementMode.Standard = 0 -> GitVersion.SemanticVersion.IncrementMode
556-
GitVersion.SemanticVersion.IncrementVersion(GitVersion.VersionField incrementStrategy) -> GitVersion.SemanticVersion!
557556
GitVersion.SemanticVersion.IsEmpty() -> bool
558557
GitVersion.SemanticVersion.IsEqualTo(GitVersion.SemanticVersion? value, bool includePreRelease = true) -> bool
559558
GitVersion.SemanticVersion.IsGreaterThan(GitVersion.SemanticVersion? value, bool includePreRelease = true) -> bool

src/GitVersion.Core/SemVer/SemanticVersion.cs

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -327,64 +327,6 @@ public string ToString(string? format, IFormatProvider? formatProvider)
327327
}
328328
}
329329

330-
public SemanticVersion IncrementVersion(VersionField incrementStrategy)
331-
=> IncrementVersion(incrementStrategy, null, isMainBranchRelease: true);
332-
333-
private SemanticVersion IncrementVersion(VersionField incrementStrategy, string? label, bool isMainBranchRelease)
334-
{
335-
var major = Major;
336-
var minor = Minor;
337-
var patch = Patch;
338-
339-
if (isMainBranchRelease || !PreReleaseTag.HasTag())
340-
{
341-
switch (incrementStrategy)
342-
{
343-
case VersionField.None:
344-
break;
345-
case VersionField.Major:
346-
major++;
347-
minor = 0;
348-
patch = 0;
349-
break;
350-
case VersionField.Minor:
351-
minor++;
352-
patch = 0;
353-
break;
354-
case VersionField.Patch:
355-
patch++;
356-
break;
357-
default:
358-
throw new ArgumentOutOfRangeException(nameof(incrementStrategy));
359-
}
360-
}
361-
362-
string preReleaseTagName = string.Empty;
363-
long? preReleaseTagNumber = null;
364-
365-
if (!isMainBranchRelease)
366-
{
367-
if (PreReleaseTag.HasTag())
368-
{
369-
preReleaseTagNumber = PreReleaseTag.Number + 1;
370-
preReleaseTagName = PreReleaseTag.Name;
371-
}
372-
else
373-
{
374-
preReleaseTagNumber = 1;
375-
preReleaseTagName = label ?? string.Empty;
376-
}
377-
}
378-
379-
return new(this)
380-
{
381-
Major = major,
382-
Minor = minor,
383-
Patch = patch,
384-
PreReleaseTag = new(preReleaseTagName, preReleaseTagNumber, true)
385-
};
386-
}
387-
388330
public SemanticVersion Increment(VersionField incrementStrategy, string? label)
389331
=> Increment(incrementStrategy, label, mode: IncrementMode.Standard);
390332

0 commit comments

Comments
 (0)