mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
enhance: navigate to upstream head after fetch, pull, and merge (#1180)
This commit is contained in:
parent
245de9b458
commit
17cf402c78
9 changed files with 60 additions and 12 deletions
|
@ -717,6 +717,11 @@ namespace SourceGit.ViewModels
|
|||
_watcher?.SetEnabled(enabled);
|
||||
}
|
||||
|
||||
public void SetNeedNavigateToUpstreamHead()
|
||||
{
|
||||
_needNavigateToUpstreamHead = true;
|
||||
}
|
||||
|
||||
public void MarkBranchesDirtyManually()
|
||||
{
|
||||
if (_watcher == null)
|
||||
|
@ -773,6 +778,15 @@ namespace SourceGit.ViewModels
|
|||
NavigateToCommit(_currentBranch.Head);
|
||||
}
|
||||
|
||||
public void NavigateToCurrentUpstreamHead()
|
||||
{
|
||||
if (_currentBranch == null || string.IsNullOrEmpty(_currentBranch.Upstream))
|
||||
return;
|
||||
var branch = _branches.Find(x => x.FullName == _currentBranch.Upstream);
|
||||
if (branch != null)
|
||||
NavigateToCommit(branch.Head);
|
||||
}
|
||||
|
||||
public void ClearHistoriesFilter()
|
||||
{
|
||||
_settings.HistoriesFilters.Clear();
|
||||
|
@ -991,6 +1005,11 @@ namespace SourceGit.ViewModels
|
|||
_histories.IsLoading = false;
|
||||
_histories.Commits = commits;
|
||||
_histories.Graph = graph;
|
||||
if (_needNavigateToUpstreamHead)
|
||||
{
|
||||
NavigateToCurrentUpstreamHead();
|
||||
_needNavigateToUpstreamHead = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2588,5 +2607,6 @@ namespace SourceGit.ViewModels
|
|||
private bool _isAutoFetching = false;
|
||||
private Timer _autoFetchTimer = null;
|
||||
private DateTime _lastFetchTime = DateTime.MinValue;
|
||||
private bool _needNavigateToUpstreamHead = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue