Add fetch all branches on pull. (acts like fetch+pull)

This commit is contained in:
RevenantX 2024-07-27 12:52:01 +03:00
parent 7bfb684bde
commit 8a38b6afac
4 changed files with 24 additions and 1 deletions

View file

@ -58,6 +58,12 @@ namespace SourceGit.ViewModels
get => _repo.Settings.PreferRebaseInsteadOfMerge;
set => _repo.Settings.PreferRebaseInsteadOfMerge = value;
}
public bool FetchAllBranchesOnPull
{
get => _repo.Settings.FetchAllBranchesOnPull;
set => _repo.Settings.FetchAllBranchesOnPull = value;
}
public bool NoTags
{
@ -151,6 +157,12 @@ namespace SourceGit.ViewModels
}
}
if (FetchAllBranchesOnPull)
{
SetProgressDescription($"Fetching remote: {_selectedRemote.Name}...");
new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, false, NoTags, SetProgressDescription).Exec();
}
SetProgressDescription($"Pull {_selectedRemote.Name}/{_selectedBranch.Name}...");
var rs = new Commands.Pull(_repo.FullPath, _selectedRemote.Name, _selectedBranch.Name, UseRebase, NoTags, SetProgressDescription).Exec();
if (rs && needPopStash)