Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Commands/Clone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public Clone(string ctx, string path, string url, string localName, string sshKe
WorkingDirectory = path;
TraitErrorAsOutput = true;
SSHKey = sshKey;
Args = "clone --progress --verbose --recurse-submodules ";
Args = "clone --progress --verbose ";

if (!string.IsNullOrEmpty(extraArgs))
Args += $"{extraArgs} ";
Expand Down
2 changes: 0 additions & 2 deletions src/Commands/QuerySubmodules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public QuerySubmodules(string repo)
{
var submodules = new List<Models.Submodule>();
var rs = ReadToEnd();
if (!rs.IsSuccess)
return submodules;

var builder = new StringBuilder();
var lines = rs.StdOut.Split('\n', System.StringSplitOptions.RemoveEmptyEntries);
Expand Down
8 changes: 8 additions & 0 deletions src/ViewModels/Clone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ public override Task<bool> Sure()
config.Set("remote.origin.sshkey", _sshKey);
}

// individually update submodule (if any)
var submoduleList = new Commands.QuerySubmodules(path).Result();
foreach (var submodule in submoduleList)
{
var update = new Commands.Submodule(path);
update.Update(submodule.Path, true, true, false, SetProgressDescription);
}

CallUIThread(() =>
{
var node = Preferences.Instance.FindOrAddNodeByRepositoryPath(path, null, true);
Expand Down
27 changes: 13 additions & 14 deletions src/ViewModels/UpdateSubmodules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,24 @@ public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);

string target = string.Empty;
List<string> targets;
if (_updateAll)
{
ProgressDescription = "Updating submodules ...";
}
targets = Submodules;
else
{
target = SelectedSubmodule;
ProgressDescription = $"Updating submodule {target} ...";
}
targets = [SelectedSubmodule];

return Task.Run(() =>
{
new Commands.Submodule(_repo.FullPath).Update(
target,
EnableInit,
EnableRecursive,
EnableRemote,
SetProgressDescription);
foreach (var submodule in targets)
{
ProgressDescription = $"Updating submodule {submodule} ...";
new Commands.Submodule(_repo.FullPath).Update(
submodule,
EnableInit,
EnableRecursive,
EnableRemote,
SetProgressDescription);
}

CallUIThread(() => _repo.SetWatcherEnabled(true));
return true;
Expand Down