feat(*): 为 Pull、Fetch、Push 增加 --recurse-submodules 选项参数

This commit is contained in:
ZCShou 2020-07-24 19:52:47 +08:00
parent d29e5def4b
commit ceff6ef102
8 changed files with 84 additions and 26 deletions

View file

@ -53,7 +53,7 @@ namespace SourceGit.UI {
var remoteBranch = upstream.Substring(remoteIdx + 1);
Task.Run(() => {
repo.Push(remote, current.Name, remoteBranch, PopupManager.UpdateStatus);
repo.Push(remote, current.Name, remoteBranch, "--recurse-submodules=no", PopupManager.UpdateStatus);
push.Dispatcher.Invoke(() => {
PopupManager.Close(true);
});
@ -89,7 +89,19 @@ namespace SourceGit.UI {
var remoteBranch = combRemoteBranches.SelectedItem as string;
var track = string.IsNullOrEmpty(localBranch.Upstream);
var tags = chkTags.IsChecked == true;
var force = chkForce.IsChecked == true;
var force = chkForce.IsChecked == true;
string subMod;
if (RbtnRrsSubModCheck.IsChecked == true) {
subMod = "--recurse-submodules=check";
} else if (RbtnRrsSubModDemand.IsChecked == true) {
subMod = "--recurse-submodules=on-demand";
}
else if (RbtnRrsSubModOnly.IsChecked == true) {
subMod = "--recurse-submodules=only";
} else{
subMod = "--recurse-submodules=no";
}
remoteBranch = remoteBranch.Substring($"{remote}/".Length);
if (remoteBranch.Contains(" (new)")) {
@ -97,7 +109,7 @@ namespace SourceGit.UI {
}
PopupManager.Lock();
await Task.Run(() => repo.Push(remote, localBranch.Name, remoteBranch, PopupManager.UpdateStatus, tags, track, force));
await Task.Run(() => repo.Push(remote, localBranch.Name, remoteBranch, subMod, PopupManager.UpdateStatus, tags, track, force));
PopupManager.Close(true);
}