Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 08898c7

Browse files
Merge branch 'master' into enhancements/using-cache-invalidated-events
2 parents 146b65d + 63ff89b commit 08898c7

File tree

6 files changed

+34
-17
lines changed

6 files changed

+34
-17
lines changed

docs/contributing/how-to-build.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repository is LFS-enabled. To clone it, you should use a git client that su
66

77
### Windows
88

9-
- Visual Studio 2015+ or Mono 4.x + bash shell (git bash).
9+
- Visual Studio 2015+ or [Mono 4.x](https://download.mono-project.com/archive/4.8.1/windows-installer/) + bash shell (git bash).
1010
- Mono 5.x will not work
1111
- `UnityEngine.dll` and `UnityEditor.dll`.
1212
- If you've installed Unity in the default location of `C:\Program Files\Unity` or `C:\Program Files (x86)\Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from `[Unity installation path]\Unity\Editor\Data\Managed` into the `lib` directory in order for the build to work
@@ -48,7 +48,7 @@ To build with Visual Studio 2015+, open the solution file `GitHub.Unity.sln`. Se
4848

4949
### Mono and Bash (windows and mac)
5050

51-
To build with Mono 4.x and Bash execute `build.sh` in a bash shell.
51+
To build with Mono 4.x and Bash, first ensure Mono is added to PATH. Mono installs to `C:\Program Files\Mono\bin\` by default. Then execute `build.sh` in a bash shell.
5252

5353
## Build Output
5454

src/GitHub.Api/Helpers/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ static class Constants
99
public const string UsageFile = "usage.json";
1010
public const string GitInstallPathKey = "GitInstallPath";
1111
public const string TraceLoggingKey = "EnableTraceLogging";
12+
public const string Iso8601Format = "o";
1213

1314
public static readonly Version MinimumGitVersion = new Version(2, 11, 0);
1415
public static readonly Version MinimumGitLfsVersion = new Version(2, 3, 4);

src/GitHub.Api/OutputProcessors/LogEntryOutputProcessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ private void ReturnGitLogEntry()
329329
Summary = summary,
330330
Description = description,
331331
CommitID = commitId,
332-
TimeString = time.Value.ToString(DateTimeFormatInfo.CurrentInfo),
333-
CommitTimeString = committerTime.Value.ToString(DateTimeFormatInfo.CurrentInfo)
332+
TimeString = time.Value.ToString(Constants.Iso8601Format),
333+
CommitTimeString = committerTime.Value.ToString(Constants.Iso8601Format)
334334
});
335335
}
336336

src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
4-
using Octokit;
55
using UnityEditor;
66
using UnityEngine;
77
using Application = UnityEngine.Application;
@@ -183,14 +183,22 @@ public DateTimeOffset LastUpdatedAt
183183
{
184184
if (!lastUpdatedAtValue.HasValue)
185185
{
186-
lastUpdatedAtValue = DateTimeOffset.Parse(LastUpdatedAtString);
186+
DateTimeOffset result;
187+
if (DateTimeOffset.TryParseExact(LastUpdatedAtString, Constants.Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
188+
{
189+
lastUpdatedAtValue = result;
190+
}
191+
else
192+
{
193+
lastUpdatedAtValue = DateTimeOffset.MinValue;
194+
}
187195
}
188196

189197
return lastUpdatedAtValue.Value;
190198
}
191199
set
192200
{
193-
LastUpdatedAtString = value.ToString();
201+
LastUpdatedAtString = value.ToString(Constants.Iso8601Format);
194202
lastUpdatedAtValue = null;
195203
}
196204
}
@@ -201,14 +209,22 @@ public DateTimeOffset LastVerifiedAt
201209
{
202210
if (!lastVerifiedAtValue.HasValue)
203211
{
204-
lastVerifiedAtValue = DateTimeOffset.Parse(LastVerifiedAtString);
212+
DateTimeOffset result;
213+
if (DateTimeOffset.TryParseExact(LastVerifiedAtString, Constants.Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
214+
{
215+
lastVerifiedAtValue = result;
216+
}
217+
else
218+
{
219+
lastVerifiedAtValue = DateTimeOffset.MinValue;
220+
}
205221
}
206222

207223
return lastVerifiedAtValue.Value;
208224
}
209225
set
210226
{
211-
LastVerifiedAtString = value.ToString();
227+
LastVerifiedAtString = value.ToString(Constants.Iso8601Format);
212228
lastVerifiedAtValue = null;
213229
}
214230
}

src/tests/IntegrationTests/Process/ProcessManagerIntegrationTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public async Task LogEntriesTest()
5757
CommitID = "018997938335742f8be694240a7c2b352ec0835f",
5858
Description = "Moving project files where they should be kept",
5959
Summary = "Moving project files where they should be kept",
60-
TimeString = firstCommitTime.ToString(DateTimeFormatInfo.CurrentInfo),
61-
CommitTimeString = firstCommitTime.ToString(DateTimeFormatInfo.CurrentInfo),
60+
TimeString = firstCommitTime.ToString(Constants.Iso8601Format),
61+
CommitTimeString = firstCommitTime.ToString(Constants.Iso8601Format),
6262
},
6363
new GitLogEntry
6464
{
@@ -75,8 +75,8 @@ public async Task LogEntriesTest()
7575
CommitID = "03939ffb3eb8486dba0259b43db00842bbe6eca1",
7676
Description = "Initial Commit",
7777
Summary = "Initial Commit",
78-
TimeString = secondCommitTime.ToString(DateTimeFormatInfo.CurrentInfo),
79-
CommitTimeString = secondCommitTime.ToString(DateTimeFormatInfo.CurrentInfo),
78+
TimeString = secondCommitTime.ToString(Constants.Iso8601Format),
79+
CommitTimeString = secondCommitTime.ToString(Constants.Iso8601Format),
8080
},
8181
});
8282
}
@@ -110,8 +110,8 @@ public async Task RussianLogEntriesTest()
110110
CommitID = "06d6451d351626894a30e9134f551db12c74254b",
111111
Description = "Я люблю github",
112112
Summary = "Я люблю github",
113-
TimeString = commitTime.ToString(DateTimeFormatInfo.CurrentInfo),
114-
CommitTimeString = commitTime.ToString(DateTimeFormatInfo.CurrentInfo),
113+
TimeString = commitTime.ToString(Constants.Iso8601Format),
114+
CommitTimeString = commitTime.ToString(Constants.Iso8601Format),
115115
}
116116
});
117117
}

src/tests/UnitTests/IO/LogEntryOutputProcessorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public void ShouldParseSingleCommit()
5858
},
5959
Summary = "Rename RepositoryModelBase to RepositoryModel",
6060
Description = "Rename RepositoryModelBase to RepositoryModel",
61-
TimeString = commitTime.ToString(DateTimeFormatInfo.CurrentInfo),
62-
CommitTimeString = commitTime.ToString(DateTimeFormatInfo.CurrentInfo),
61+
TimeString = commitTime.ToString(Constants.Iso8601Format),
62+
CommitTimeString = commitTime.ToString(Constants.Iso8601Format),
6363
},
6464
};
6565

0 commit comments

Comments
 (0)