@@ -717,6 +717,11 @@ public void SetWatcherEnabled(bool enabled)
717
717
_watcher ? . SetEnabled ( enabled ) ;
718
718
}
719
719
720
+ public void SetNeedNavigateToUpstreamHead ( )
721
+ {
722
+ _needNavigateToUpstreamHead = true ;
723
+ }
724
+
720
725
public void MarkBranchesDirtyManually ( )
721
726
{
722
727
if ( _watcher == null )
@@ -773,6 +778,15 @@ public void NavigateToCurrentHead()
773
778
NavigateToCommit ( _currentBranch . Head ) ;
774
779
}
775
780
781
+ public void NavigateToCurrentUpstreamHead ( )
782
+ {
783
+ if ( _currentBranch == null || string . IsNullOrEmpty ( _currentBranch . Upstream ) )
784
+ return ;
785
+ var branch = _branches . Find ( x => x . FullName == _currentBranch . Upstream ) ;
786
+ if ( branch != null )
787
+ NavigateToCommit ( branch . Head ) ;
788
+ }
789
+
776
790
public void ClearHistoriesFilter ( )
777
791
{
778
792
_settings . HistoriesFilters . Clear ( ) ;
@@ -991,6 +1005,11 @@ public void RefreshCommits()
991
1005
_histories . IsLoading = false ;
992
1006
_histories . Commits = commits ;
993
1007
_histories . Graph = graph ;
1008
+ if ( _needNavigateToUpstreamHead )
1009
+ {
1010
+ NavigateToCurrentUpstreamHead ( ) ;
1011
+ _needNavigateToUpstreamHead = false ;
1012
+ }
994
1013
}
995
1014
} ) ;
996
1015
}
@@ -2588,5 +2607,6 @@ private void AutoFetchImpl(object sender)
2588
2607
private bool _isAutoFetching = false ;
2589
2608
private Timer _autoFetchTimer = null ;
2590
2609
private DateTime _lastFetchTime = DateTime . MinValue ;
2610
+ private bool _needNavigateToUpstreamHead = false ;
2591
2611
}
2592
2612
}
0 commit comments