feature: allow changing of tracking branch on push (#142)

This commit is contained in:
leo 2024-05-25 11:37:06 +08:00
parent 8e3a8f4c06
commit 754a2527f5
4 changed files with 15 additions and 5 deletions

View file

@ -130,7 +130,6 @@
<x:String x:Key="Text.DeleteBranch.IsRemoteTip" xml:space="preserve">You are about to delete a remote branch!!!</x:String>
<x:String x:Key="Text.DeleteBranch.WithTrackingRemote" xml:space="preserve">Also delete remote branch${0}$</x:String>
<x:String x:Key="Text.DeleteMultiBranch" xml:space="preserve">Delete Multiple Branches</x:String>
<x:String x:Key="Text.DeleteMultiBranch.Targets" xml:space="preserve">Targets : </x:String>
<x:String x:Key="Text.DeleteMultiBranch.Tip" xml:space="preserve">You are trying to delete multiple branches at one time. Be sure to double-check before taking action!</x:String>
<x:String x:Key="Text.DeleteRemote" xml:space="preserve">Delete Remote</x:String>
<x:String x:Key="Text.DeleteRemote.Remote" xml:space="preserve">Remote :</x:String>
@ -319,6 +318,7 @@
<x:String x:Key="Text.Push.Remote" xml:space="preserve">Remote :</x:String>
<x:String x:Key="Text.Push.Title" xml:space="preserve">Push Changes To Remote</x:String>
<x:String x:Key="Text.Push.To" xml:space="preserve">Remote Branch :</x:String>
<x:String x:Key="Text.Push.Tracking" xml:space="preserve">Tracking remote branch--set-upstream</x:String>
<x:String x:Key="Text.Push.WithAllTags" xml:space="preserve">Push all tags</x:String>
<x:String x:Key="Text.PushTag" xml:space="preserve">Push Tag To Remote</x:String>
<x:String x:Key="Text.PushTag.PushAllRemotes" xml:space="preserve">Push to all remotes</x:String>

View file

@ -130,7 +130,6 @@
<x:String x:Key="Text.DeleteBranch.IsRemoteTip" xml:space="preserve">您正在删除远程上的分支,请务必小心!!!</x:String>
<x:String x:Key="Text.DeleteBranch.WithTrackingRemote" xml:space="preserve">同时删除远程分支${0}$</x:String>
<x:String x:Key="Text.DeleteMultiBranch" xml:space="preserve">删除多个分支</x:String>
<x:String x:Key="Text.DeleteMultiBranch.Targets" xml:space="preserve">分支列表 </x:String>
<x:String x:Key="Text.DeleteMultiBranch.Tip" xml:space="preserve">您正在尝试一次性删除多个分支,请务必仔细检查后再执行操作!</x:String>
<x:String x:Key="Text.DeleteRemote" xml:space="preserve">删除远程确认</x:String>
<x:String x:Key="Text.DeleteRemote.Remote" xml:space="preserve">远程名 </x:String>
@ -319,6 +318,7 @@
<x:String x:Key="Text.Push.Remote" xml:space="preserve">远程仓库 </x:String>
<x:String x:Key="Text.Push.Title" xml:space="preserve">推送到远程仓库</x:String>
<x:String x:Key="Text.Push.To" xml:space="preserve">远程分支 </x:String>
<x:String x:Key="Text.Push.Tracking" xml:space="preserve">跟踪远程分支(--set-upstream</x:String>
<x:String x:Key="Text.Push.WithAllTags" xml:space="preserve">同时推送标签</x:String>
<x:String x:Key="Text.PushTag" xml:space="preserve">推送标签到远程仓库</x:String>
<x:String x:Key="Text.PushTag.PushAllRemotes" xml:space="preserve">推送到所有远程仓库</x:String>

View file

@ -82,6 +82,12 @@ namespace SourceGit.ViewModels
set;
}
public bool Tracking
{
get;
set;
} = true;
public bool ForcePush
{
get;
@ -154,7 +160,7 @@ namespace SourceGit.ViewModels
remoteBranchName,
PushAllTags,
ForcePush,
string.IsNullOrEmpty(_selectedLocalBranch.Upstream),
Tracking,
SetProgressDescription).Exec();
CallUIThread(() => _repo.SetWatcherEnabled(true));
return succ;

View file

@ -13,7 +13,7 @@
Classes="bold"
Text="{DynamicResource Text.Push.Title}"/>
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,32,32" ColumnDefinitions="150,*">
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,32,32,32" ColumnDefinitions="150,*">
<TextBlock Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,8,0"
@ -73,10 +73,14 @@
</ComboBox>
<CheckBox Grid.Row="3" Grid.Column="1"
Content="{DynamicResource Text.Push.Tracking}"
IsChecked="{Binding Tracking, Mode=TwoWay}"/>
<CheckBox Grid.Row="4" Grid.Column="1"
Content="{DynamicResource Text.Push.WithAllTags}"
IsChecked="{Binding PushAllTags, Mode=TwoWay}"/>
<CheckBox Grid.Row="4" Grid.Column="1"
<CheckBox Grid.Row="5" Grid.Column="1"
Content="{DynamicResource Text.Push.Force}"
IsChecked="{Binding ForcePush, Mode=TwoWay}"/>
</Grid>