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

Commit bf5ddc4

Browse files
Merge branch 'master' into file-history-view
2 parents ae8e308 + 5defe7b commit bf5ddc4

File tree

12 files changed

+143
-37
lines changed

12 files changed

+143
-37
lines changed

src/GitHub.Api/Helpers/SimpleJson.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@ private static string ToJsonPropertyName(string propertyName)
22142214
return propertyName.Substring(0, i).ToLowerInvariant() + propertyName.Substring(i);
22152215
}
22162216

2217-
class JsonSerializationStrategy : PocoJsonSerializerStrategy
2217+
public class JsonSerializationStrategy : PocoJsonSerializerStrategy
22182218
{
22192219
private bool toLowerCase = false;
22202220
private bool onlyPublic = true;

src/GitHub.Api/OutputProcessors/LogEntryOutputProcessor.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Globalization;
4+
using System.Linq;
45
using System.Text;
56
using System.Text.RegularExpressions;
67

@@ -143,7 +144,6 @@ public override void LineReceived(string line)
143144
}
144145

145146
summary = line;
146-
descriptionLines.Add(line);
147147
phase++;
148148
// there's no description so skip it
149149
if (oneliner)
@@ -313,7 +313,8 @@ private void ReturnGitLogEntry()
313313
{
314314
PopNewlines();
315315

316-
var description = string.Join(Environment.NewLine, descriptionLines.ToArray());
316+
var filteredDescriptionLines = (descriptionLines.Any() && string.IsNullOrEmpty(descriptionLines.First()) ? descriptionLines.Skip(1) : descriptionLines).ToArray();
317+
var description = string.Join(Environment.NewLine, filteredDescriptionLines);
317318

318319
if (time.HasValue)
319320
{
@@ -347,4 +348,4 @@ private enum ProcessingPhase
347348
Files = 10,
348349
}
349350
}
350-
}
351+
}

src/GitHub.Api/Platform/DefaultEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void InitializeRepository(NPath? repositoryPath = null)
8383
Guard.NotNull(this, FileSystem, nameof(FileSystem));
8484

8585
NPath expectedRepositoryPath;
86-
if (!RepositoryPath.IsInitialized)
86+
if (!RepositoryPath.IsInitialized || (repositoryPath != null && RepositoryPath != repositoryPath.Value))
8787
{
8888
Guard.NotNull(this, UnityProjectPath, nameof(UnityProjectPath));
8989

src/GitHub.Api/Tasks/ActionTask.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace GitHub.Unity
99
{
10-
class TaskQueue : TPLTask
10+
public class TaskQueue : TPLTask
1111
{
1212
private TaskCompletionSource<bool> aggregateTask = new TaskCompletionSource<bool>();
1313
private readonly List<ITask> queuedTasks = new List<ITask>();
@@ -85,7 +85,7 @@ private void TaskFinished(bool success, Exception ex)
8585
}
8686
}
8787

88-
class TaskQueue<TTaskResult, TResult> : TPLTask<List<TResult>>
88+
public class TaskQueue<TTaskResult, TResult> : TPLTask<List<TResult>>
8989
{
9090
private TaskCompletionSource<List<TResult>> aggregateTask = new TaskCompletionSource<List<TResult>>();
9191
private readonly List<ITask<TTaskResult>> queuedTasks = new List<ITask<TTaskResult>>();
@@ -190,7 +190,7 @@ private void TaskFinished(TTaskResult result, bool success, Exception ex)
190190
}
191191
}
192192

193-
class TPLTask : TaskBase
193+
public class TPLTask : TaskBase
194194
{
195195
private Task task;
196196

@@ -235,7 +235,7 @@ protected override void Run(bool success)
235235
}
236236
}
237237

238-
class TPLTask<T> : TaskBase<T>
238+
public class TPLTask<T> : TaskBase<T>
239239
{
240240
private Task<T> task;
241241

@@ -280,7 +280,7 @@ protected override T RunWithReturn(bool success)
280280
}
281281
}
282282

283-
class ActionTask : TaskBase
283+
public class ActionTask : TaskBase
284284
{
285285
protected Action<bool> Callback { get; }
286286
protected Action<bool, Exception> CallbackWithException { get; }
@@ -329,7 +329,7 @@ protected override void Run(bool success)
329329
}
330330
}
331331

332-
class ActionTask<T> : TaskBase
332+
public class ActionTask<T> : TaskBase
333333
{
334334
private readonly Func<T> getPreviousResult;
335335

@@ -415,7 +415,7 @@ protected virtual void Run(bool success, T previousResult)
415415
public T PreviousResult { get; set; } = default(T);
416416
}
417417

418-
class FuncTask<T> : TaskBase<T>
418+
public class FuncTask<T> : TaskBase<T>
419419
{
420420
protected Func<bool, T> Callback { get; }
421421
protected Func<bool, Exception, T> CallbackWithException { get; }
@@ -468,7 +468,7 @@ protected override T RunWithReturn(bool success)
468468
}
469469
}
470470

471-
class FuncTask<T, TResult> : TaskBase<T, TResult>
471+
public class FuncTask<T, TResult> : TaskBase<T, TResult>
472472
{
473473
protected Func<bool, T, TResult> Callback { get; }
474474
protected Func<bool, Exception, T, TResult> CallbackWithException { get; }
@@ -513,7 +513,7 @@ protected override TResult RunWithData(bool success, T previousResult)
513513
}
514514
}
515515

516-
class FuncListTask<T> : DataTaskBase<T, List<T>>
516+
public class FuncListTask<T> : DataTaskBase<T, List<T>>
517517
{
518518
protected Func<bool, List<T>> Callback { get; }
519519
protected Func<bool, FuncListTask<T>, List<T>> CallbackWithSelf { get; }
@@ -573,7 +573,7 @@ protected override List<T> RunWithReturn(bool success)
573573
}
574574
}
575575

576-
class FuncListTask<T, TData, TResult> : DataTaskBase<T, TData, List<TResult>>
576+
public class FuncListTask<T, TData, TResult> : DataTaskBase<T, TData, List<TResult>>
577577
{
578578
protected Func<bool, T, List<TResult>> Callback { get; }
579579
protected Func<bool, Exception, T, List<TResult>> CallbackWithException { get; }

src/GitHub.Api/Tasks/TaskBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ public override string ToString()
547547
public virtual string Message { get; set; }
548548
}
549549

550-
abstract class TaskBase<TResult> : TaskBase, ITask<TResult>
550+
public abstract class TaskBase<TResult> : TaskBase, ITask<TResult>
551551
{
552552
private event Action<bool, TResult> finallyHandler;
553553

@@ -723,7 +723,7 @@ protected override void CallFinallyHandler()
723723
public TResult Result { get { return result; } }
724724
}
725725

726-
abstract class TaskBase<T, TResult> : TaskBase<TResult>
726+
public abstract class TaskBase<T, TResult> : TaskBase<TResult>
727727
{
728728
private readonly Func<T> getPreviousResult;
729729

@@ -770,7 +770,7 @@ protected virtual TResult RunWithData(bool success, T previousResult)
770770
public T PreviousResult { get; set; } = default(T);
771771
}
772772

773-
abstract class DataTaskBase<TData, TResult> : TaskBase<TResult>, ITask<TData, TResult>
773+
public abstract class DataTaskBase<TData, TResult> : TaskBase<TResult>, ITask<TData, TResult>
774774
{
775775
public DataTaskBase(CancellationToken token)
776776
: base(token)
@@ -783,7 +783,7 @@ protected void RaiseOnData(TData data)
783783
}
784784
}
785785

786-
abstract class DataTaskBase<T, TData, TResult> : TaskBase<T, TResult>, ITask<TData, TResult>
786+
public abstract class DataTaskBase<T, TData, TResult> : TaskBase<T, TResult>, ITask<TData, TResult>
787787
{
788788
public DataTaskBase(CancellationToken token)
789789
: base(token)

src/GitHub.Api/Tasks/TaskExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace GitHub.Unity
66
{
7-
static class TaskExtensions
7+
public static class TaskExtensions
88
{
99
public static async Task StartAwait(this ITask source, Action<Exception> handler = null)
1010
{
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
22
"name": "ExtensionLoader",
3-
"references": ["../../build/GitHub.UnityShim.dll"],
3+
"references": [],
4+
"optionalUnityReferences": [],
45
"includePlatforms": [
56
"Editor"
67
],
7-
"excludePlatforms": []
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false,
10+
"overrideReferences": true,
11+
"precompiledReferences": [
12+
"GitHub.UnityShim.dll"
13+
],
14+
"autoReferenced": true
815
}

src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Utility.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@ public static Texture2D GetIcon(string filename, string filename2x = "", bool in
3737
Texture2D texture2D = null;
3838

3939
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("GitHub.Unity.IconsAndLogos." + filename);
40-
if (stream != null)
40+
if (stream == null)
4141
{
42-
texture2D = stream.ToTexture2D();
43-
}
44-
else
45-
{
46-
var iconPath = "Assets/Editor/GitHub.Unity/IconsAndLogos/" + filename;
47-
texture2D = AssetDatabase.LoadAssetAtPath<Texture2D>(iconPath);
42+
stream = new MemoryStream(Application.dataPath.ToNPath().Combine("Editor/GitHub.Unity/IconsAndLogos/", filename).ReadAllBytes());
4843
}
4944

45+
texture2D = stream.ToTexture2D();
46+
stream.Dispose();
47+
5048
if (texture2D != null)
5149
{
5250
texture2D.hideFlags = HideFlags.HideAndDontSave;

src/UnityExtension/Assets/Editor/UnityTests/UnityTests.asmdef

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
"references": [
44
"GitHub.Unity"
55
],
6+
"optionalUnityReferences": [
7+
"TestAssemblies"
8+
],
69
"includePlatforms": [
710
"Editor"
811
],
9-
"excludePlatforms": []
12+
"excludePlatforms": [],
13+
"allowUnsafeCode": false,
14+
"overrideReferences": false,
15+
"precompiledReferences": [],
16+
"autoReferenced": true,
17+
"defineConstraints": []
1018
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
m_EditorVersion: 2018.3.2f1

0 commit comments

Comments
 (0)