From 754a2527f55ab6254368e65286ab8d11f98944f9 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 25 May 2024 11:37:06 +0800 Subject: [PATCH] feature: allow changing of tracking branch on push (#142) --- src/Resources/Locales/en_US.axaml | 2 +- src/Resources/Locales/zh_CN.axaml | 2 +- src/ViewModels/Push.cs | 8 +++++++- src/Views/Push.axaml | 8 ++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 04770f37..6c14bc62 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -130,7 +130,6 @@ You are about to delete a remote branch!!! Also delete remote branch${0}$ Delete Multiple Branches - Targets : You are trying to delete multiple branches at one time. Be sure to double-check before taking action! Delete Remote Remote : @@ -319,6 +318,7 @@ Remote : Push Changes To Remote Remote Branch : + Tracking remote branch(--set-upstream) Push all tags Push Tag To Remote Push to all remotes diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 5617c1a2..5f48ca7e 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -130,7 +130,6 @@ 您正在删除远程上的分支,请务必小心!!! 同时删除远程分支${0}$ 删除多个分支 - 分支列表 : 您正在尝试一次性删除多个分支,请务必仔细检查后再执行操作! 删除远程确认 远程名 : @@ -319,6 +318,7 @@ 远程仓库 : 推送到远程仓库 远程分支 : + 跟踪远程分支(--set-upstream) 同时推送标签 推送标签到远程仓库 推送到所有远程仓库 diff --git a/src/ViewModels/Push.cs b/src/ViewModels/Push.cs index 4036d030..0ca4f9de 100644 --- a/src/ViewModels/Push.cs +++ b/src/ViewModels/Push.cs @@ -82,6 +82,12 @@ public bool PushAllTags set; } + public bool Tracking + { + get; + set; + } = true; + public bool ForcePush { get; @@ -154,7 +160,7 @@ public override Task Sure() remoteBranchName, PushAllTags, ForcePush, - string.IsNullOrEmpty(_selectedLocalBranch.Upstream), + Tracking, SetProgressDescription).Exec(); CallUIThread(() => _repo.SetWatcherEnabled(true)); return succ; diff --git a/src/Views/Push.axaml b/src/Views/Push.axaml index bb76ad26..00cdafbf 100644 --- a/src/Views/Push.axaml +++ b/src/Views/Push.axaml @@ -13,7 +13,7 @@ Classes="bold" Text="{DynamicResource Text.Push.Title}"/> - + + + -