diff --git a/src/Commands/Push.cs b/src/Commands/Push.cs index b822af46d..2a765f738 100644 --- a/src/Commands/Push.cs +++ b/src/Commands/Push.cs @@ -4,7 +4,7 @@ namespace SourceGit.Commands { public class Push : Command { - public Push(string repo, string local, string remote, string remoteBranch, bool withTags, bool checkSubmodules, bool track, bool force) + public Push(string repo, string local, string remote, string remoteBranch, bool withTags, bool checkSubmodules, bool track, bool force, string additionalFlags = "") { _remote = remote; @@ -20,6 +20,8 @@ public Push(string repo, string local, string remote, string remoteBranch, bool Args += "-u "; if (force) Args += "--force-with-lease "; + if (!string.IsNullOrWhiteSpace(additionalFlags)) + Args += $"{additionalFlags.Trim()} "; Args += $"{remote} {local}:{remoteBranch}"; } diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 0d476042e..bb1f2dc86 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -654,6 +654,7 @@ Remote Branch: Set as tracking branch Push all tags + Additional flags: Push Tag To Remote Push to all remotes Remote: diff --git a/src/ViewModels/Push.cs b/src/ViewModels/Push.cs index 10999f259..b1e3645c0 100644 --- a/src/ViewModels/Push.cs +++ b/src/ViewModels/Push.cs @@ -97,6 +97,12 @@ public bool ForcePush set; } + public string AdditionalFlags + { + get => _additionalFlags; + set => SetProperty(ref _additionalFlags, value); + } + public Push(Repository repo, Models.Branch localBranch) { _repo = repo; @@ -204,7 +210,8 @@ public override async Task Sure() PushAllTags, _repo.Submodules.Count > 0 && CheckSubmodules, _isSetTrackOptionVisible && _tracking, - ForcePush).Use(log).RunAsync(); + ForcePush, + AdditionalFlags).Use(log).RunAsync(); log.Complete(); return succ; @@ -263,5 +270,6 @@ private void AutoSelectBranchByRemote() private Models.Branch _selectedRemoteBranch = null; private bool _isSetTrackOptionVisible = false; private bool _tracking = true; + private string _additionalFlags = string.Empty; } } diff --git a/src/Views/Push.axaml b/src/Views/Push.axaml index d0475845e..0909d57a3 100644 --- a/src/Views/Push.axaml +++ b/src/Views/Push.axaml @@ -18,7 +18,7 @@ Text="{DynamicResource Text.Push.Title}"/> - + + + +