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

Commit acc015a

Browse files
Merge branch 'master' into fixes/publish-view-disable-until-load
2 parents 958ba60 + abd2566 commit acc015a

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/GitHub.Api/Metrics/UsageTracker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private async Task SendUsage()
145145
}
146146
catch (Exception ex)
147147
{
148-
Logger.Warning(ex, "Error Sending Usage");
148+
Logger.Warning(@"Error Sending Usage Exception Type:""{0}"" Message:""{1}""", ex.GetType().ToString(), ex.Message);
149149
}
150150
}
151151

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private static void Initialize()
3737

3838
if (ApplicationCache.Instance.FirstRun)
3939
{
40-
Debug.Log("Initializing GitHub for Unity version " + ApplicationInfo.Version);
40+
Debug.Log("Initialized GitHub for Unity version " + ApplicationInfo.Version);
4141

4242
var oldLogPath = logPath.Parent.Combine(logPath.FileNameWithoutExtension + "-old" + logPath.ExtensionWithDot);
4343
try
@@ -53,7 +53,7 @@ private static void Initialize()
5353
Logging.Error(ex, "Error rotating log files");
5454
}
5555

56-
Debug.Log("Initializing GitHub for Unity log file: " + logPath);
56+
Debug.Log("Initialized GitHub for Unity log file: " + logPath);
5757
}
5858
Logging.LogAdapter = new FileLogAdapter(logPath);
5959
Logging.Info("Initializing GitHub for Unity version " + ApplicationInfo.Version);

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/SettingsView.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class SettingsView : Subview
6767
private const string DefaultRepositoryRemoteName = "origin";
6868

6969
[NonSerialized] private int newGitIgnoreRulesSelection = -1;
70-
[NonSerialized] private ConfigRemote? activeRemote;
7170

7271
[SerializeField] private string gitName;
7372
[SerializeField] private string gitEmail;
@@ -94,6 +93,8 @@ public override void OnEnable()
9493
{
9594
base.OnEnable();
9695
AttachHandlers(Repository);
96+
97+
remoteHasChanged = true;
9798
}
9899

99100
public override void OnDisable()
@@ -114,8 +115,9 @@ public override void OnRepositoryChanged(IRepository oldRepository)
114115

115116
DetachHandlers(oldRepository);
116117
AttachHandlers(Repository);
117-
activeRemote = Repository.CurrentRemote;
118+
118119
remoteHasChanged = true;
120+
119121
Refresh();
120122
}
121123

@@ -178,7 +180,7 @@ private void MaybeUpdateData()
178180

179181
if (Repository == null)
180182
{
181-
if (cachedUser == null || String.IsNullOrEmpty(cachedUser.Name))
183+
if ((cachedUser == null || String.IsNullOrEmpty(cachedUser.Name)) && GitClient != null)
182184
{
183185
var user = new User();
184186
GitClient.GetConfig("user.name", GitConfigSource.User)
@@ -221,6 +223,7 @@ private void MaybeUpdateData()
221223
if (remoteHasChanged)
222224
{
223225
remoteHasChanged = false;
226+
var activeRemote = Repository.CurrentRemote;
224227
hasRemote = activeRemote.HasValue && !String.IsNullOrEmpty(activeRemote.Value.Url);
225228
if (!hasRemote)
226229
{
@@ -245,7 +248,6 @@ private void ResetToDefaults()
245248

246249
private void Repository_OnActiveRemoteChanged(string remote)
247250
{
248-
activeRemote = Repository.CurrentRemote;
249251
remoteHasChanged = true;
250252
}
251253

0 commit comments

Comments
 (0)