@@ -717,6 +717,11 @@ public void SetWatcherEnabled(bool enabled)
717717 _watcher ? . SetEnabled ( enabled ) ;
718718 }
719719
720+ public void SetNeedNavigateToUpstreamHead ( )
721+ {
722+ _needNavigateToUpstreamHead = true ;
723+ }
724+
720725 public void MarkBranchesDirtyManually ( )
721726 {
722727 if ( _watcher == null )
@@ -773,6 +778,15 @@ public void NavigateToCurrentHead()
773778 NavigateToCommit ( _currentBranch . Head ) ;
774779 }
775780
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+
776790 public void ClearHistoriesFilter ( )
777791 {
778792 _settings . HistoriesFilters . Clear ( ) ;
@@ -991,6 +1005,11 @@ public void RefreshCommits()
9911005 _histories . IsLoading = false ;
9921006 _histories . Commits = commits ;
9931007 _histories . Graph = graph ;
1008+ if ( _needNavigateToUpstreamHead )
1009+ {
1010+ NavigateToCurrentUpstreamHead ( ) ;
1011+ _needNavigateToUpstreamHead = false ;
1012+ }
9941013 }
9951014 } ) ;
9961015 }
@@ -2588,5 +2607,6 @@ private void AutoFetchImpl(object sender)
25882607 private bool _isAutoFetching = false ;
25892608 private Timer _autoFetchTimer = null ;
25902609 private DateTime _lastFetchTime = DateTime . MinValue ;
2610+ private bool _needNavigateToUpstreamHead = false ;
25912611 }
25922612}
0 commit comments