enhance: update submodules individually (#1272)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-05-09 17:12:12 +08:00
parent 6cf1b20ea6
commit 3e530de9cc
No known key found for this signature in database
4 changed files with 24 additions and 14 deletions

View file

@ -68,8 +68,15 @@ namespace SourceGit.ViewModels
}
}
var rs = new Commands.Checkout(_repo.FullPath).Use(log).Branch(Branch, updateSubmodules);
if (needPopStash)
var rs = new Commands.Checkout(_repo.FullPath).Use(log).Branch(Branch);
if (rs && updateSubmodules)
{
var submodules = new Commands.QuerySubmodules(_repo.FullPath).Result();
foreach (var submodule in submodules)
new Commands.Submodule(_repo.FullPath).Use(log).Update(submodule.Path, true, true, false);
}
if (rs && needPopStash)
rs = new Commands.Stash(_repo.FullPath).Use(log).Pop("stash@{0}");
log.Complete();