Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Fix to resolve Git Tag sorting issue #300 (#307)
Browse files Browse the repository at this point in the history
* fix to resolve #300, properly sorts the tag versions returned by Git based on a 3 digit version code.  Select the actual latest version based on:

x.x.x version number

Previously, last was determined by the double value parsed value, which is incorrectly sorted by .NET.  Now sorts by each individual version identifier to locate the latest.

* Restored missing variable
  • Loading branch information
SimonDarksideJ authored and StephenHodgson committed Sep 3, 2019
1 parent 2db3364 commit 3ba9896
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ internal static async Task<Tuple<MixedRealityPackageInfo, bool>[]> GetCurrentMix

private static async Task AddPackageAsync(MixedRealityPackageInfo packageInfo)
{
var tag = (await GitUtilities.GetAllTagsFromRemoteAsync(packageInfo.Uri)).LastOrDefault();
var versionSeperator = new char[] { '.' };
var tag = (await GitUtilities.GetAllTagsFromRemoteAsync(packageInfo.Uri)).OrderBy(value => int.Parse(value.Split(versionSeperator)[0])).ThenBy(value => int.Parse(value.Split(versionSeperator)[1])).ThenBy(value => int.Parse(value.Split(versionSeperator)[2])).LastOrDefault();
var addRequest = Client.Add($"{packageInfo.Name}@{packageInfo.Uri}#{tag}");

await addRequest.WaitUntil(request => request.IsCompleted, timeout: 30);
Expand Down

0 comments on commit 3ba9896

Please sign in to comment.