mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
Add fetch all branches on pull. (acts like fetch+pull)
This commit is contained in:
parent
7bfb684bde
commit
8a38b6afac
4 changed files with 24 additions and 1 deletions
|
@ -34,6 +34,12 @@ namespace SourceGit.Models
|
||||||
set;
|
set;
|
||||||
} = false;
|
} = false;
|
||||||
|
|
||||||
|
public bool FetchAllBranchesOnPull
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
} = false;
|
||||||
|
|
||||||
public bool PushAllTags
|
public bool PushAllTags
|
||||||
{
|
{
|
||||||
get;
|
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.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" 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.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.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" xml:space="preserve">Local Changes:</x:String>
|
||||||
<x:String x:Key="Text.Pull.LocalChanges.Discard" xml:space="preserve">Discard</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;
|
get => _repo.Settings.PreferRebaseInsteadOfMerge;
|
||||||
set => _repo.Settings.PreferRebaseInsteadOfMerge = value;
|
set => _repo.Settings.PreferRebaseInsteadOfMerge = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool FetchAllBranchesOnPull
|
||||||
|
{
|
||||||
|
get => _repo.Settings.FetchAllBranchesOnPull;
|
||||||
|
set => _repo.Settings.FetchAllBranchesOnPull = value;
|
||||||
|
}
|
||||||
|
|
||||||
public bool NoTags
|
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}...");
|
SetProgressDescription($"Pull {_selectedRemote.Name}/{_selectedBranch.Name}...");
|
||||||
var rs = new Commands.Pull(_repo.FullPath, _selectedRemote.Name, _selectedBranch.Name, UseRebase, NoTags, SetProgressDescription).Exec();
|
var rs = new Commands.Pull(_repo.FullPath, _selectedRemote.Name, _selectedBranch.Name, UseRebase, NoTags, SetProgressDescription).Exec();
|
||||||
if (rs && needPopStash)
|
if (rs && needPopStash)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<TextBlock FontSize="18"
|
<TextBlock FontSize="18"
|
||||||
Classes="bold"
|
Classes="bold"
|
||||||
Text="{DynamicResource Text.Pull.Title}"/>
|
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"
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||||
Margin="0,0,8,0"
|
Margin="0,0,8,0"
|
||||||
|
@ -91,6 +91,10 @@
|
||||||
<CheckBox Grid.Row="5" Grid.Column="1"
|
<CheckBox Grid.Row="5" Grid.Column="1"
|
||||||
Content="{DynamicResource Text.Pull.NoTags}"
|
Content="{DynamicResource Text.Pull.NoTags}"
|
||||||
IsChecked="{Binding NoTags, Mode=TwoWay}"/>
|
IsChecked="{Binding NoTags, Mode=TwoWay}"/>
|
||||||
|
|
||||||
|
<CheckBox Grid.Row="6" Grid.Column="1"
|
||||||
|
Content="{DynamicResource Text.Pull.FetchAllBranchesOnPull}"
|
||||||
|
IsChecked="{Binding FetchAllBranchesOnPull, Mode=TwoWay}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
Loading…
Reference in a new issue