Skip to content

Commit 69bea26

Browse files
committed
Update version test to account for GitVersioning change
1 parent 97bcd0b commit 69bea26

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: LibGit2Sharp.Tests/GlobalSettingsFixture.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public void CanGetMinimumCompiledInFeatures()
2222
public void CanRetrieveValidVersionString()
2323
{
2424
// Version string format is:
25-
// Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features)
25+
// Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features)
2626
// Example output:
27-
// "0.25.0-preview.52+g871d13a67f.libgit2-15e1193 (x86 - Threads, Https)"
27+
// "0.25.0-preview.52+871d13a67f.libgit2-15e1193 (x86 - Threads, Https)"
2828

2929
string versionInfo = GlobalSettings.Version.ToString();
3030

@@ -33,14 +33,14 @@ public void CanRetrieveValidVersionString()
3333
// git2SharpHash: '871d13a67f' LibGit2Sharp hash.
3434
// arch: 'x86' or 'x64' libgit2 target.
3535
// git2Features: 'Threads, Ssh' libgit2 features compiled with.
36-
string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?\+(g(?<git2SharpHash>[a-f0-9]{10})\.)?libgit2-[a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$";
36+
string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?\+((?<git2SharpHash>[a-f0-9]{10})\.)?libgit2-[a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$";
3737

3838
Assert.NotNull(versionInfo);
3939

4040
Match regexResult = Regex.Match(versionInfo, regex);
4141

4242
Assert.True(regexResult.Success, "The following version string format is enforced:" +
43-
"Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features). " +
43+
"Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features). " +
4444
"But found \"" + versionInfo + "\" instead.");
4545
}
4646

Diff for: LibGit2Sharp/Version.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private string RetrieveAbbrevShaFrom(string sha)
5555
/// </summary>
5656
/// <para>
5757
/// The format of the version number is as follows:
58-
/// <para>Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features)</para>
58+
/// <para>Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features)</para>
5959
/// </para>
6060
/// <returns></returns>
6161
public override string ToString()

0 commit comments

Comments
 (0)