mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
code_review: PR (#288)
* add missing translations and it's no need to add `OnPull` suffix since it already has a prefix `Text.Pull.` * when enable fetching all branches of selected remote, use merge/rebase command instead of pull * re-arrange orders of options in pull popup panel * default enable `Fetch all branches`
This commit is contained in:
parent
924a2ce935
commit
4612cecf10
6 changed files with 33 additions and 13 deletions
|
@ -59,7 +59,7 @@ namespace SourceGit.ViewModels
|
|||
set => _repo.Settings.PreferRebaseInsteadOfMerge = value;
|
||||
}
|
||||
|
||||
public bool FetchAllBranchesOnPull
|
||||
public bool FetchAllBranches
|
||||
{
|
||||
get => _repo.Settings.FetchAllBranchesOnPull;
|
||||
set => _repo.Settings.FetchAllBranchesOnPull = value;
|
||||
|
@ -157,14 +157,32 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
if (FetchAllBranchesOnPull)
|
||||
var rs = false;
|
||||
if (FetchAllBranches)
|
||||
{
|
||||
SetProgressDescription($"Fetching remote: {_selectedRemote.Name}...");
|
||||
new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, false, NoTags, SetProgressDescription).Exec();
|
||||
rs = new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, false, NoTags, SetProgressDescription).Exec();
|
||||
if (!rs)
|
||||
return false;
|
||||
|
||||
// Use merge/rebase instead of pull as fetch is done manually.
|
||||
if (UseRebase)
|
||||
{
|
||||
SetProgressDescription($"Rebase {_current.Name} on {_selectedBranch.FriendlyName} ...");
|
||||
rs = new Commands.Rebase(_repo.FullPath, _selectedBranch.FriendlyName, false).Exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetProgressDescription($"Merge {_selectedBranch.FriendlyName} into {_current.Name} ...");
|
||||
rs = new Commands.Merge(_repo.FullPath, _selectedBranch.FriendlyName, "", SetProgressDescription).Exec();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetProgressDescription($"Pull {_selectedRemote.Name}/{_selectedBranch.Name}...");
|
||||
rs = new Commands.Pull(_repo.FullPath, _selectedRemote.Name, _selectedBranch.Name, UseRebase, 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)
|
||||
{
|
||||
SetProgressDescription("Re-apply local changes...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue