perf: only update uninited or outdated submodules
Some checks are pending
Continuous Integration / Build (push) Waiting to run
Continuous Integration / Prepare version string (push) Waiting to run
Continuous Integration / Package (push) Blocked by required conditions
Localization Check / localization-check (push) Waiting to run

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-05-21 17:49:39 +08:00
parent 1872740265
commit 1fef7a7baa
No known key found for this signature in database
8 changed files with 55 additions and 36 deletions

View file

@ -74,9 +74,9 @@ namespace SourceGit.ViewModels
{
if (updateSubmodules)
{
var submodules = new Commands.QuerySubmodules(_repo.FullPath).Result();
var submodules = new Commands.QueryUpdatableSubmodules(_repo.FullPath).Result();
if (submodules.Count > 0)
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodules, true, true, false);
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodules, true, true);
}
if (needPopStash)

View file

@ -74,9 +74,9 @@ namespace SourceGit.ViewModels
{
if (updateSubmodules)
{
var submodules = new Commands.QuerySubmodules(_repo.FullPath).Result();
var submodules = new Commands.QueryUpdatableSubmodules(_repo.FullPath).Result();
if (submodules.Count > 0)
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodules, true, true, false);
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodules, true, true);
}
if (needPop)

View file

@ -140,9 +140,9 @@ namespace SourceGit.ViewModels
if (InitAndUpdateSubmodules)
{
var submodules = new Commands.QuerySubmodules(path).Result();
var submodules = new Commands.QueryUpdatableSubmodules(path).Result();
if (submodules.Count > 0)
new Commands.Submodule(path).Use(log).Update(submodules, true, true, false);
new Commands.Submodule(path).Use(log).Update(submodules, true, true);
}
log.Complete();

View file

@ -144,9 +144,9 @@ namespace SourceGit.ViewModels
{
if (updateSubmodules)
{
var submodules = new Commands.QuerySubmodules(_repo.FullPath).Result();
var submodules = new Commands.QueryUpdatableSubmodules(_repo.FullPath).Result();
if (submodules.Count > 0)
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodules, true, true, false);
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodules, true, true);
}
if (needPopStash)

View file

@ -153,9 +153,9 @@ namespace SourceGit.ViewModels
{
if (updateSubmodules)
{
var submodules = new Commands.QuerySubmodules(_repo.FullPath).Result();
var submodules = new Commands.QueryUpdatableSubmodules(_repo.FullPath).Result();
if (submodules.Count > 0)
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodules, true, true, false);
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodules, true, true);
}
if (needPopStash)

View file

@ -65,14 +65,9 @@ namespace SourceGit.ViewModels
return Task.Run(() =>
{
foreach (var submodule in targets)
{
new Commands.Submodule(_repo.FullPath).Use(log).Update(
submodule,
EnableInit,
EnableRecursive,
EnableRemote);
}
new Commands.Submodule(_repo.FullPath)
.Use(log)
.Update(targets, EnableInit, EnableRecursive, EnableRemote);
log.Complete();
CallUIThread(() => _repo.SetWatcherEnabled(true));