Skip to content

Commit a1841d2

Browse files
JDanRibeiroCopilot
authored andcommitted
Update src/GitVersion.Core/Git/ReferenceName.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8c823e2 commit a1841d2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/GitVersion.Core/Git/ReferenceName.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ public static bool TryParseMergeRequestsRef(string? canonicalRef, out int mergeR
106106
var suffix = after[(slash + 1)..];
107107
if (!suffix.Equals("head", StringComparison.OrdinalIgnoreCase) && !suffix.Equals("merge", StringComparison.OrdinalIgnoreCase))
108108
return false;
109-
return int.TryParse(after.Substring(0, slash), System.Globalization.NumberStyles.None, System.Globalization.CultureInfo.InvariantCulture, out mergeRequestId);
109+
return int.TryParse(after.Substring(0, slash), System.Globalization.NumberStyles.None, System.Globalization.CultureInfo.InvariantCulture, out mergeRequestId)
110+
&& iid > 0;
110111
}
111112

112113
/// <summary>

0 commit comments

Comments
 (0)