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

Commit 68566d4

Browse files
authored
Merge pull request #215 from github-for-unity/fixes/publish-view-placeholder
Fix to use correct remote name in Pull/Push changes dialog
2 parents 618540a + 6e31048 commit 68566d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class HistoryView : Subview
3737
private const int HistoryExtraItemCount = 10;
3838
private const float MaxChangelistHeightRatio = .2f;
3939

40-
[NonSerialized] private string currentRemote = "placeholder";
4140
[NonSerialized] private int historyStartIndex;
4241
[NonSerialized] private int historyStopIndex;
4342
[NonSerialized] private float lastWidth;
@@ -62,6 +61,8 @@ class HistoryView : Subview
6261
[SerializeField] private ChangesetTreeView changesetTree = new ChangesetTreeView();
6362
[SerializeField] private List<GitLogEntry> history = new List<GitLogEntry>();
6463
[SerializeField] private bool isBusy;
64+
[SerializeField] private string currentRemote;
65+
[SerializeField] private bool isPublished;
6566

6667
public override void InitializeView(IView parent)
6768
{
@@ -196,7 +197,6 @@ private void UpdateStatusOnMainThread(GitStatus status)
196197

197198
private void UpdateStatus(GitStatus status)
198199
{
199-
currentRemote = Repository.CurrentRemote.HasValue ? Repository.CurrentRemote.Value.Name : null;
200200
statusAhead = status.Ahead;
201201
statusBehind = status.Behind;
202202
}
@@ -224,6 +224,9 @@ private void OnLogUpdate(List<GitLogEntry> entries)
224224

225225
private void MaybeUpdateData()
226226
{
227+
isPublished = Repository.CurrentRemote.HasValue;
228+
currentRemote = isPublished ? Repository.CurrentRemote.Value.Name : "placeholder";
229+
227230
if (!updated)
228231
return;
229232
updated = false;
@@ -347,8 +350,6 @@ public void OnEmbeddedGUI()
347350

348351
GUILayout.FlexibleSpace();
349352

350-
351-
var isPublished = Repository.CurrentRemote.HasValue;
352353
if (isPublished)
353354
{
354355
GUI.enabled = currentRemote != null;

0 commit comments

Comments
 (0)