Skip to content

Commit

Permalink
#3924 - fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Feb 25, 2024
1 parent 57fb1ac commit 912988a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/GitVersion.Core/VersionCalculation/IncrementStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using GitVersion.Configuration;

namespace GitVersion;

public enum IncrementStrategy
Expand All @@ -8,21 +6,5 @@ public enum IncrementStrategy
Major,
Minor,
Patch,
/// <summary>
/// Uses the <see cref="IBranchConfiguration.Increment"/>, <see cref="IBranchConfiguration.PreventIncrementOfMergedBranchVersion"/> and <see cref="IBranchConfiguration.TracksReleaseBranches"/>
/// of the "parent" branch (i.e. the branch where the current branch was branched from).
/// </summary>
Inherit
}

public static class IncrementStrategyExtensions
{
public static VersionField ToVersionField(this IncrementStrategy strategy) => strategy switch
{
IncrementStrategy.None => VersionField.None,
IncrementStrategy.Major => VersionField.Major,
IncrementStrategy.Minor => VersionField.Minor,
IncrementStrategy.Patch => VersionField.Patch,
_ => throw new ArgumentOutOfRangeException(nameof(strategy), strategy, null)
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace GitVersion;

public static class IncrementStrategyExtensions
{
public static VersionField ToVersionField(this IncrementStrategy strategy) => strategy switch
{
IncrementStrategy.None => VersionField.None,
IncrementStrategy.Major => VersionField.Major,
IncrementStrategy.Minor => VersionField.Minor,
IncrementStrategy.Patch => VersionField.Patch,
_ => throw new ArgumentOutOfRangeException(nameof(strategy), strategy, null)
};
}

0 comments on commit 912988a

Please sign in to comment.