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

Commit 4a5f9db

Browse files
Merge branch 'master' into fixes/isolating-favorites
2 parents 95315d7 + 0953865 commit 4a5f9db

File tree

5 files changed

+29
-52
lines changed

5 files changed

+29
-52
lines changed

src/GitHub.Api/Git/Repository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ private void RepositoryManager_OnRemoteBranchRemoved(string remote, string name)
303303
Dictionary<string, ConfigBranch> branchList;
304304
if (remoteBranches.TryGetValue(remote, out branchList))
305305
{
306-
if (localBranches.ContainsKey(name))
306+
if (branchList.ContainsKey(name))
307307
{
308-
localBranches.Remove(name);
308+
branchList.Remove(name);
309309

310310
Logger.Trace("OnRemoteBranchListChanged");
311311
OnRemoteBranchListChanged?.Invoke();

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#pragma warning disable 649
2-
31
using System;
42
using System.Linq;
53
using UnityEditor;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#pragma warning disable 649
2-
31
using System;
42
using System.Collections.Generic;
53
using System.IO;

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#pragma warning disable 649
2-
31
using System;
42
using System.Collections.Generic;
53
using System.Linq;
@@ -42,7 +40,6 @@ class HistoryView : Subview
4240
[NonSerialized] private int selectionIndex;
4341
[NonSerialized] private bool logHasChanged;
4442
[NonSerialized] private bool useScrollTime;
45-
[NonSerialized] private bool isBusy;
4643

4744
[SerializeField] private Vector2 detailsScroll;
4845
[SerializeField] private Vector2 scroll;
@@ -650,7 +647,7 @@ private void DrawTimelineRectAroundIconRect(Rect parentRect, Rect iconRect)
650647

651648
public override bool IsBusy
652649
{
653-
get { return isBusy; }
650+
get { return false; }
654651
}
655652

656653
private float EntryHeight

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

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#pragma warning disable 649
2-
31
using System;
42
using System.Linq;
53
using UnityEditor;
@@ -109,19 +107,7 @@ public override void OnDataUpdate()
109107
{
110108
base.OnDataUpdate();
111109

112-
string repoRemote = null;
113-
if (MaybeUpdateData(out repoRemote))
114-
{
115-
repoBranchContent = new GUIContent(repoBranch, Window_RepoBranchTooltip);
116-
if (repoUrl != null)
117-
{
118-
repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, repoRemote));
119-
}
120-
else
121-
{
122-
repoUrlContent = new GUIContent(repoUrl, Window_RepoNoUrlTooltip);
123-
}
124-
}
110+
MaybeUpdateData();
125111

126112
if (ActiveView != null)
127113
ActiveView.OnDataUpdate();
@@ -198,45 +184,43 @@ private void RefreshOnMainThread()
198184
new ActionTask(TaskManager.Token, Refresh) { Affinity = TaskAffinity.UI }.Start();
199185
}
200186

201-
private bool MaybeUpdateData(out string repoRemote)
187+
private void MaybeUpdateData()
202188
{
203-
repoRemote = null;
204-
bool repoDataChanged = false;
189+
string updatedRepoBranch = null;
190+
string updatedRepoRemote = null;
191+
string updatedRepoUrl = DefaultRepoUrl;
192+
205193
if (Repository != null)
206194
{
207-
var currentBranchString = (Repository.CurrentBranch.HasValue ? Repository.CurrentBranch.Value.Name : null);
208-
if (repoBranch != currentBranchString)
209-
{
210-
repoBranch = currentBranchString;
211-
repoDataChanged = true;
212-
}
195+
var repositoryCurrentBranch = Repository.CurrentBranch;
196+
updatedRepoBranch = repositoryCurrentBranch.HasValue ? repositoryCurrentBranch.Value.Name : null;
213197

214-
var url = Repository.CloneUrl != null ? Repository.CloneUrl.ToString() : DefaultRepoUrl;
215-
if (repoUrl != url)
216-
{
217-
repoUrl = url;
218-
repoDataChanged = true;
219-
}
198+
var repositoryCloneUrl = Repository.CloneUrl;
199+
updatedRepoUrl = repositoryCloneUrl != null ? repositoryCloneUrl.ToString() : DefaultRepoUrl;
220200

221-
if (Repository.CurrentRemote.HasValue)
222-
repoRemote = Repository.CurrentRemote.Value.Name;
201+
var repositoryCurrentRemote = Repository.CurrentRemote;
202+
if (repositoryCurrentRemote.HasValue)
203+
updatedRepoRemote = repositoryCurrentRemote.Value.Name;
223204
}
224-
else
205+
206+
if (repoBranch != updatedRepoBranch)
207+
{
208+
repoBranch = updatedRepoBranch;
209+
repoBranchContent = new GUIContent(repoBranch, Window_RepoBranchTooltip);
210+
}
211+
212+
if (repoUrl != updatedRepoUrl)
225213
{
226-
if (repoBranch != null)
214+
repoUrl = updatedRepoUrl;
215+
if (updatedRepoRemote != null)
227216
{
228-
repoBranch = null;
229-
repoDataChanged = true;
217+
repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, updatedRepoRemote));
230218
}
231-
232-
if (repoUrl != DefaultRepoUrl)
219+
else
233220
{
234-
repoUrl = DefaultRepoUrl;
235-
repoDataChanged = true;
221+
repoUrlContent = new GUIContent(repoUrl, Window_RepoNoUrlTooltip);
236222
}
237223
}
238-
239-
return repoDataChanged;
240224
}
241225

242226
private void AttachHandlers(IRepository repository)

0 commit comments

Comments
 (0)