feature<GitFlow>: add an option to keep branch after finish

This commit is contained in:
Rwing 2021-05-13 15:31:10 +08:00
parent 524eb8ef6d
commit 0f38b157e2
5 changed files with 23 additions and 5 deletions

View file

@ -10,6 +10,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition Height="32"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -31,5 +32,17 @@
Grid.Row="0" Grid.Column="2"
Margin="4,0,0,0"
x:Name="txtName"/>
<TextBlock
Grid.Row="1" Grid.Column="0"
Margin="0,0,8,0"
x:Name="txtKeep"
HorizontalAlignment="Right"
Text="{StaticResource Text.GitFlow.KeepBranchAfterFinish}"/>
<CheckBox
Grid.Row="1" Grid.Column="2"
Margin="0,4,0,0"
x:Name="chkKeep"
IsChecked="False"
/>
</Grid>
</controls:PopupWidget>

View file

@ -46,9 +46,11 @@ namespace SourceGit.Views.Popups {
}
public override Task<bool> Start() {
var keepBranch = chkKeep.IsChecked == true;
return Task.Run(() => {
Models.Watcher.SetEnabled(repo, false);
new Commands.GitFlow(repo).Finish(type, name);
new Commands.GitFlow(repo).Finish(type, name, keepBranch);
Models.Watcher.SetEnabled(repo, true);
return true;
});