mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-07 11:54:59 +00:00
perf: only update uninited or outdated submodules
Some checks are pending
Some checks are pending
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
1872740265
commit
1fef7a7baa
8 changed files with 55 additions and 36 deletions
|
@ -29,23 +29,7 @@ namespace SourceGit.Commands
|
|||
}
|
||||
}
|
||||
|
||||
public bool Update(string module, bool init, bool recursive, bool useRemote)
|
||||
{
|
||||
Args = "submodule update";
|
||||
|
||||
if (init)
|
||||
Args += " --init";
|
||||
if (recursive)
|
||||
Args += " --recursive";
|
||||
if (useRemote)
|
||||
Args += " --remote";
|
||||
if (!string.IsNullOrEmpty(module))
|
||||
Args += $" -- \"{module}\"";
|
||||
|
||||
return Exec();
|
||||
}
|
||||
|
||||
public bool Update(List<Models.Submodule> modules, bool init, bool recursive, bool useRemote)
|
||||
public bool Update(List<string> modules, bool init, bool recursive, bool useRemote = false)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
builder.Append("submodule update");
|
||||
|
@ -60,7 +44,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
builder.Append(" --");
|
||||
foreach (var module in modules)
|
||||
builder.Append($" \"{module.Path}\"");
|
||||
builder.Append($" \"{module}\"");
|
||||
}
|
||||
|
||||
Args = builder.ToString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue