enhance: navigate to upstream head after fetch, pull, and merge (#1180)

This commit is contained in:
Gadfly 2025-04-14 10:42:34 +08:00 committed by GitHub
parent 245de9b458
commit 17cf402c78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 60 additions and 12 deletions

View file

@ -34,14 +34,14 @@ namespace SourceGit.ViewModels
set => _repo.Settings.EnableForceOnFetch = value;
}
public Fetch(Repository repo, Models.Remote preferedRemote = null)
public Fetch(Repository repo, Models.Remote preferredRemote = null)
{
_repo = repo;
_fetchAllRemotes = preferedRemote == null;
_fetchAllRemotes = preferredRemote == null;
if (preferedRemote != null)
if (preferredRemote != null)
{
SelectedRemote = preferedRemote;
SelectedRemote = preferredRemote;
}
else if (!string.IsNullOrEmpty(_repo.Settings.DefaultRemote))
{
@ -83,6 +83,7 @@ namespace SourceGit.ViewModels
CallUIThread(() =>
{
_repo.SetNeedNavigateToUpstreamHead();
_repo.MarkFetched();
_repo.SetWatcherEnabled(true);
});