mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
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:
commit
924a2ce935
4 changed files with 24 additions and 1 deletions
|
@ -34,6 +34,12 @@ namespace SourceGit.Models
|
|||
set;
|
||||
} = false;
|
||||
|
||||
public bool FetchAllBranchesOnPull
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = false;
|
||||
|
||||
public bool PushAllTags
|
||||
{
|
||||
get;
|
||||
|
|
|
@ -403,6 +403,7 @@
|
|||
<x:String x:Key="Text.PruneWorktrees.Tip" xml:space="preserve">Prune worktree information in `$GIT_DIR/worktrees`</x:String>
|
||||
<x:String x:Key="Text.Pull" xml:space="preserve">Pull</x:String>
|
||||
<x:String x:Key="Text.Pull.Branch" xml:space="preserve">Branch:</x:String>
|
||||
<x:String x:Key="Text.Pull.FetchAllBranchesOnPull" xml:space="preserve">Fetch all branches on pull</x:String>
|
||||
<x:String x:Key="Text.Pull.Into" xml:space="preserve">Into:</x:String>
|
||||
<x:String x:Key="Text.Pull.LocalChanges" xml:space="preserve">Local Changes:</x:String>
|
||||
<x:String x:Key="Text.Pull.LocalChanges.Discard" xml:space="preserve">Discard</x:String>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<TextBlock FontSize="18"
|
||||
Classes="bold"
|
||||
Text="{DynamicResource Text.Pull.Title}"/>
|
||||
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,32,32,32" ColumnDefinitions="140,*">
|
||||
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,32,32,32,32" ColumnDefinitions="140,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"
|
||||
|
@ -91,6 +91,10 @@
|
|||
<CheckBox Grid.Row="5" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Pull.NoTags}"
|
||||
IsChecked="{Binding NoTags, Mode=TwoWay}"/>
|
||||
|
||||
<CheckBox Grid.Row="6" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Pull.FetchAllBranchesOnPull}"
|
||||
IsChecked="{Binding FetchAllBranchesOnPull, Mode=TwoWay}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
|
Loading…
Reference in a new issue