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

Commit 138dfdc

Browse files
Disabling the pull button if there is no remote
Returning null from RepositoryManager if there are no repositories
1 parent fa937a0 commit 138dfdc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/GitHub.Api/RepositoryManager.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,13 @@ private void LoadRemotesFromConfig()
519519
return remote;
520520
}
521521

522-
return config.GetRemotes().FirstOrDefault();
522+
var configRemotes = config.GetRemotes().ToArray();
523+
if (configRemotes.Any())
524+
{
525+
return configRemotes.First();
526+
}
527+
528+
return null;
523529
}
524530

525531
private ConfigBranch? GetActiveBranch()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public void OnEmbeddedGUI()
330330
}
331331

332332
var pushButtonText = statusAhead > 0 ? String.Format(PushButtonCount, statusAhead) : PushButton;
333-
GUI.enabled = statusBehind == 0;
333+
GUI.enabled = currentRemote != null && statusBehind == 0;
334334
var pushClicked = GUILayout.Button(pushButtonText, Styles.HistoryToolbarButtonStyle);
335335
GUI.enabled = true;
336336
if (pushClicked &&

0 commit comments

Comments
 (0)