Skip to content

Commit a50892a

Browse files
committed
minor refactoring in MergeMessage.cs
1 parent 26b5465 commit a50892a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/GitVersion.Core/MergeMessage.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public MergeMessage(string mergeMessage, IGitVersionConfiguration configuration)
5050

5151
Version = ParseVersion(
5252
configuration.VersionInBranchRegex, configuration.LabelPrefix, configuration.SemanticVersionFormat
53-
)?.Value;
53+
);
5454

5555
break;
5656
}
@@ -64,11 +64,10 @@ public MergeMessage(string mergeMessage, IGitVersionConfiguration configuration)
6464
public int? PullRequestNumber { get; }
6565
public SemanticVersion? Version { get; }
6666

67-
private (SemanticVersion Value, string? Name)? ParseVersion(
68-
Regex versionPatternRegex, string? labelPrefix, SemanticVersionFormat format)
67+
private SemanticVersion? ParseVersion(Regex versionInBranchRegex, string? labelPrefix, SemanticVersionFormat format)
6968
{
70-
if (MergedBranch?.TryGetSemanticVersion(out var result, versionPatternRegex, labelPrefix, format) == true)
71-
return result;
69+
if (MergedBranch?.TryGetSemanticVersion(out var result, versionInBranchRegex, labelPrefix, format) == true)
70+
return result.Value;
7271
return null;
7372
}
7473

0 commit comments

Comments
 (0)