diff --git a/SourceGit/Git/Remote.cs b/SourceGit/Git/Remote.cs
index ed32e810..1d1ade87 100644
--- a/SourceGit/Git/Remote.cs
+++ b/SourceGit/Git/Remote.cs
@@ -57,7 +57,7 @@ namespace SourceGit.Git {
if (errs != null) {
App.RaiseError(errs);
} else {
- repo.Fetch(new Remote() { Name = name }, true, null);
+ repo.Fetch(new Remote() { Name = name }, "--recurse-submodules=on-demand", true, null);
}
}
diff --git a/SourceGit/Git/Repository.cs b/SourceGit/Git/Repository.cs
index a96c93ae..b52f0b40 100644
--- a/SourceGit/Git/Repository.cs
+++ b/SourceGit/Git/Repository.cs
@@ -448,12 +448,13 @@ namespace SourceGit.Git {
/// Fetch remote changes
///
///
+ /// submod
///
///
- public void Fetch(Remote remote, bool prune, Action onProgress) {
+ public void Fetch(Remote remote, string submod, bool prune, Action onProgress) {
isWatcherDisabled = true;
- var args = "-c credential.helper=manager fetch --progress --verbose ";
+ var args = $"-c credential.helper=manager fetch --progress --verbose {submod} ";
if (prune) args += "--prune ";
@@ -475,14 +476,15 @@ namespace SourceGit.Git {
///
/// remote
/// branch
+ /// submod
/// Progress message handler.
/// Use rebase instead of merge.
/// Auto stash local changes.
/// Progress message handler.
- public void Pull(string remote, string branch, Action onProgress, bool rebase = false, bool autostash = false) {
+ public void Pull(string remote, string branch, string submod, Action onProgress, bool rebase = false, bool autostash = false) {
isWatcherDisabled = true;
- var args = "-c credential.helper=manager pull --verbose --progress ";
+ var args = $"-c credential.helper=manager pull --verbose --progress {submod} ";
var needPopStash = false;
if (rebase) args += "--rebase ";
@@ -518,14 +520,15 @@ namespace SourceGit.Git {
/// Remote
/// Local branch name
/// Remote branch name
+ /// submod
/// Progress message handler.
/// Push tags
/// Create track reference
/// Force push
- public void Push(string remote, string localBranch, string remoteBranch, Action onProgress, bool withTags = false, bool track = false, bool force = false) {
+ public void Push(string remote, string localBranch, string remoteBranch, string submod, Action onProgress, bool withTags = false, bool track = false, bool force = false) {
isWatcherDisabled = true;
- var args = "-c credential.helper=manager push --progress --verbose ";
+ var args = $"-c credential.helper=manager push --progress --verbose {submod} ";
if (withTags) args += "--tags ";
if (track) args += "-u ";
diff --git a/SourceGit/UI/Fetch.xaml b/SourceGit/UI/Fetch.xaml
index 550ed554..11e59594 100644
--- a/SourceGit/UI/Fetch.xaml
+++ b/SourceGit/UI/Fetch.xaml
@@ -6,7 +6,7 @@
xmlns:git="clr-namespace:SourceGit.Git"
xmlns:converters="clr-namespace:SourceGit.Converters"
mc:Ignorable="d"
- d:DesignHeight="192" d:DesignWidth="500" Height="192" Width="500">
+ d:DesignHeight="192" d:DesignWidth="500" Height="224" Width="500">
@@ -14,6 +14,7 @@
+
@@ -41,17 +42,24 @@
-
+
+
+
+
+
+
+
-
-
+
diff --git a/SourceGit/UI/Fetch.xaml.cs b/SourceGit/UI/Fetch.xaml.cs
index 1068c518..8de01ebd 100644
--- a/SourceGit/UI/Fetch.xaml.cs
+++ b/SourceGit/UI/Fetch.xaml.cs
@@ -49,15 +49,24 @@ namespace SourceGit.UI {
///
///
private async void Start(object sender, RoutedEventArgs e) {
- bool prune = chkPrune.IsChecked == true;
+ bool prune = chkPrune.IsChecked == true;
+
+ string subMod;
+ if (RbtnRrsSubModYes.IsChecked == true) {
+ subMod = "--recurse-submodules=yes";
+ } else if (RbtnRrsSubModNo.IsChecked == true) {
+ subMod = "--recurse-submodules=no";
+ } else {
+ subMod = "--recurse-submodules=on-demand";
+ }
PopupManager.Lock();
if (chkFetchAll.IsChecked == true) {
- await Task.Run(() => repo.Fetch(null, prune, PopupManager.UpdateStatus));
+ await Task.Run(() => repo.Fetch(null, subMod, prune, PopupManager.UpdateStatus));
} else {
var remote = combRemotes.SelectedItem as Git.Remote;
- await Task.Run(() => repo.Fetch(remote, prune, PopupManager.UpdateStatus));
+ await Task.Run(() => repo.Fetch(remote, subMod, prune, PopupManager.UpdateStatus));
}
PopupManager.Close(true);
diff --git a/SourceGit/UI/Pull.xaml b/SourceGit/UI/Pull.xaml
index 57c0e072..f24c67f0 100644
--- a/SourceGit/UI/Pull.xaml
+++ b/SourceGit/UI/Pull.xaml
@@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
- d:DesignHeight="248" d:DesignWidth="500" Height="248" Width="500">
+ d:DesignHeight="248" d:DesignWidth="500" Height="280" Width="500">
@@ -12,6 +12,7 @@
+
@@ -60,19 +61,26 @@
-
+
+
+
+
+
+
+
-
-
+
diff --git a/SourceGit/UI/Pull.xaml.cs b/SourceGit/UI/Pull.xaml.cs
index e88fea7d..a23dbfbb 100644
--- a/SourceGit/UI/Pull.xaml.cs
+++ b/SourceGit/UI/Pull.xaml.cs
@@ -76,8 +76,17 @@ namespace SourceGit.UI {
if (remote == null || branch == null) return;
+ string subMod;
+ if (RbtnRrsSubModYes.IsChecked == true) {
+ subMod = "--recurse-submodules=yes";
+ } else if (RbtnRrsSubModNo.IsChecked == true) {
+ subMod = "--recurse-submodules=no";
+ } else {
+ subMod = "--recurse-submodules=on-demand";
+ }
+
PopupManager.Lock();
- await Task.Run(() => repo.Pull(remote, branch.Substring(branch.IndexOf('/')+1), PopupManager.UpdateStatus, rebase, autoStash));
+ await Task.Run(() => repo.Pull(remote, branch.Substring(branch.IndexOf('/')+1), subMod, PopupManager.UpdateStatus, rebase, autoStash));
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Push.xaml b/SourceGit/UI/Push.xaml
index b5ed0148..cba7865e 100644
--- a/SourceGit/UI/Push.xaml
+++ b/SourceGit/UI/Push.xaml
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:git="clr-namespace:SourceGit.Git"
mc:Ignorable="d"
- d:DesignHeight="248" d:DesignWidth="500" Height="248" Width="500">
+ d:DesignHeight="248" d:DesignWidth="500" Height="280" Width="500">
@@ -13,6 +13,7 @@
+
@@ -70,17 +71,25 @@
-
+
+
+
+
+
+
+
+
-
-
+
diff --git a/SourceGit/UI/Push.xaml.cs b/SourceGit/UI/Push.xaml.cs
index 5b9e4a81..54ab54d2 100644
--- a/SourceGit/UI/Push.xaml.cs
+++ b/SourceGit/UI/Push.xaml.cs
@@ -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);
}