Merge pull request #288 from RevenantX/fetch_all_on_pull_option

Add fetch all branches on pull option (acts like fetch+pull)
This commit is contained in:
leo 2024-07-27 19:58:03 +08:00 committed by GitHub
commit 924a2ce935
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)