@@ -40,6 +40,7 @@ class Window : BaseWindow
40
40
[ SerializeField ] private int statusAhead ;
41
41
[ SerializeField ] private int statusBehind ;
42
42
[ SerializeField ] private bool hasItemsToCommit ;
43
+ [ SerializeField ] private bool isTrackingRemoteBranch ;
43
44
[ SerializeField ] private GUIContent currentBranchContent ;
44
45
[ SerializeField ] private GUIContent currentRemoteUrlContent ;
45
46
[ SerializeField ] private CacheUpdateEvent lastCurrentBranchAndRemoteChangedEvent ;
@@ -279,7 +280,17 @@ private void MaybeUpdateData()
279
280
currentBranchAndRemoteHasUpdate = false ;
280
281
281
282
var repositoryCurrentBranch = Repository . CurrentBranch ;
282
- var updatedRepoBranch = repositoryCurrentBranch . HasValue ? repositoryCurrentBranch . Value . Name : null ;
283
+ string updatedRepoBranch ;
284
+ if ( repositoryCurrentBranch . HasValue )
285
+ {
286
+ updatedRepoBranch = repositoryCurrentBranch . Value . Name ;
287
+ isTrackingRemoteBranch = ! string . IsNullOrEmpty ( repositoryCurrentBranch . Value . Tracking ) ;
288
+ }
289
+ else
290
+ {
291
+ updatedRepoBranch = null ;
292
+ isTrackingRemoteBranch = false ;
293
+ }
283
294
284
295
var repositoryCurrentRemote = Repository . CurrentRemote ;
285
296
if ( repositoryCurrentRemote . HasValue )
@@ -313,6 +324,8 @@ private void MaybeUpdateData()
313
324
}
314
325
else
315
326
{
327
+ isTrackingRemoteBranch = false ;
328
+
316
329
if ( currentRemoteName != null )
317
330
{
318
331
currentRemoteName = null ;
@@ -591,7 +604,7 @@ private void DoActionbarGUI()
591
604
EditorGUI . EndDisabledGroup ( ) ;
592
605
593
606
// Push button
594
- EditorGUI . BeginDisabledGroup ( currentRemoteName == null || statusAhead == 0 ) ;
607
+ EditorGUI . BeginDisabledGroup ( currentRemoteName == null || isTrackingRemoteBranch && statusAhead == 0 ) ;
595
608
{
596
609
var pushButtonText = statusAhead > 0 ? new GUIContent ( String . Format ( Localization . PushButtonCount , statusAhead ) ) : pushButtonContent ;
597
610
var pushClicked = GUILayout . Button ( pushButtonText , Styles . ToolbarButtonStyle ) ;
0 commit comments