mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
feature: add an option to enable --recurse-submodules=check
on push (#345)
This commit is contained in:
parent
d66053a42d
commit
d4a9343eaf
7 changed files with 39 additions and 10 deletions
|
@ -4,7 +4,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
public class Push : Command
|
||||
{
|
||||
public Push(string repo, string local, string remote, string remoteBranch, bool withTags, bool force, bool track, Action<string> onProgress)
|
||||
public Push(string repo, string local, string remote, string remoteBranch, bool withTags, bool checkSubmodules, bool track, bool force, Action<string> onProgress)
|
||||
{
|
||||
_outputHandler = onProgress;
|
||||
|
||||
|
@ -16,6 +16,8 @@ namespace SourceGit.Commands
|
|||
|
||||
if (withTags)
|
||||
Args += "--tags ";
|
||||
if (checkSubmodules)
|
||||
Args += "--recurse-submodules=check ";
|
||||
if (track)
|
||||
Args += "-u ";
|
||||
if (force)
|
||||
|
|
|
@ -40,6 +40,12 @@ namespace SourceGit.Models
|
|||
set;
|
||||
} = true;
|
||||
|
||||
public bool CheckSubmodulesOnPush
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = true;
|
||||
|
||||
public bool PushAllTags
|
||||
{
|
||||
get;
|
||||
|
|
|
@ -430,6 +430,7 @@
|
|||
<x:String x:Key="Text.Pull.Title" xml:space="preserve">Pull (Fetch & Merge)</x:String>
|
||||
<x:String x:Key="Text.Pull.UseRebase" xml:space="preserve">Use rebase instead of merge</x:String>
|
||||
<x:String x:Key="Text.Push" xml:space="preserve">Push</x:String>
|
||||
<x:String x:Key="Text.Push.CheckSubmodules" xml:space="preserve">Make sure submodules have been pushed</x:String>
|
||||
<x:String x:Key="Text.Push.Force" xml:space="preserve">Force push</x:String>
|
||||
<x:String x:Key="Text.Push.Local" xml:space="preserve">Local Branch:</x:String>
|
||||
<x:String x:Key="Text.Push.Remote" xml:space="preserve">Remote:</x:String>
|
||||
|
|
|
@ -433,6 +433,7 @@
|
|||
<x:String x:Key="Text.Pull.Title" xml:space="preserve">拉回(拉取并合并)</x:String>
|
||||
<x:String x:Key="Text.Pull.UseRebase" xml:space="preserve">使用变基方式合并分支</x:String>
|
||||
<x:String x:Key="Text.Push" xml:space="preserve">推送(push)</x:String>
|
||||
<x:String x:Key="Text.Push.CheckSubmodules" xml:space="preserve">确保子模块变更已推送</x:String>
|
||||
<x:String x:Key="Text.Push.Force" xml:space="preserve">启用强制推送</x:String>
|
||||
<x:String x:Key="Text.Push.Local" xml:space="preserve">本地分支 :</x:String>
|
||||
<x:String x:Key="Text.Push.Remote" xml:space="preserve">远程仓库 :</x:String>
|
||||
|
|
|
@ -433,6 +433,7 @@
|
|||
<x:String x:Key="Text.Pull.Title" xml:space="preserve">拉回(拉取併合並)</x:String>
|
||||
<x:String x:Key="Text.Pull.UseRebase" xml:space="preserve">使用變基方式合併分支</x:String>
|
||||
<x:String x:Key="Text.Push" xml:space="preserve">推送(push)</x:String>
|
||||
<x:String x:Key="Text.Push.CheckSubmodules" xml:space="preserve">確保子模組變更已推送</x:String>
|
||||
<x:String x:Key="Text.Push.Force" xml:space="preserve">啟用強制推送</x:String>
|
||||
<x:String x:Key="Text.Push.Local" xml:space="preserve">本地分支 :</x:String>
|
||||
<x:String x:Key="Text.Push.Remote" xml:space="preserve">遠端倉庫 :</x:String>
|
||||
|
|
|
@ -62,12 +62,6 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public bool PushAllTags
|
||||
{
|
||||
get => _repo.Settings.PushAllTags;
|
||||
set => _repo.Settings.PushAllTags = value;
|
||||
}
|
||||
|
||||
public bool IsSetTrackOptionVisible
|
||||
{
|
||||
get => _isSetTrackOptionVisible;
|
||||
|
@ -80,6 +74,23 @@ namespace SourceGit.ViewModels
|
|||
set;
|
||||
} = true;
|
||||
|
||||
public bool IsCheckSubmodulesVisible
|
||||
{
|
||||
get => _repo.Submodules.Count > 0;
|
||||
}
|
||||
|
||||
public bool CheckSubmodules
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = true;
|
||||
|
||||
public bool PushAllTags
|
||||
{
|
||||
get => _repo.Settings.PushAllTags;
|
||||
set => _repo.Settings.PushAllTags = value;
|
||||
}
|
||||
|
||||
public bool ForcePush
|
||||
{
|
||||
get;
|
||||
|
@ -151,8 +162,9 @@ namespace SourceGit.ViewModels
|
|||
_selectedRemote.Name,
|
||||
remoteBranchName,
|
||||
PushAllTags,
|
||||
ForcePush,
|
||||
_repo.Submodules.Count > 0 && CheckSubmodules,
|
||||
_isSetTrackOptionVisible && Tracking,
|
||||
ForcePush,
|
||||
SetProgressDescription).Exec();
|
||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||
return succ;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
Classes="bold"
|
||||
Text="{DynamicResource Text.Push.Title}"/>
|
||||
|
||||
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,Auto,32,32" ColumnDefinitions="150,*">
|
||||
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,Auto,Auto,32,32" ColumnDefinitions="130,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"
|
||||
|
@ -78,10 +78,16 @@
|
|||
IsVisible="{Binding IsSetTrackOptionVisible}"/>
|
||||
|
||||
<CheckBox Grid.Row="4" Grid.Column="1"
|
||||
Height="32"
|
||||
Content="{DynamicResource Text.Push.CheckSubmodules}"
|
||||
IsChecked="{Binding CheckSubmodules, Mode=TwoWay}"
|
||||
IsVisible="{Binding IsCheckSubmodulesVisible}"/>
|
||||
|
||||
<CheckBox Grid.Row="5" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Push.WithAllTags}"
|
||||
IsChecked="{Binding PushAllTags, Mode=TwoWay}"/>
|
||||
|
||||
<CheckBox Grid.Row="5" Grid.Column="1"
|
||||
<CheckBox Grid.Row="6" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Push.Force}"
|
||||
IsChecked="{Binding ForcePush, Mode=TwoWay}"/>
|
||||
</Grid>
|
||||
|
|
Loading…
Reference in a new issue