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

@ -142,8 +142,15 @@ namespace SourceGit.ViewModels
}
}
succ = new Commands.Checkout(_repo.FullPath).Use(log).Branch(fixedName, _baseOnRevision, updateSubmodules);
if (needPopStash)
succ = new Commands.Checkout(_repo.FullPath).Use(log).Branch(fixedName, _baseOnRevision);
if (succ && 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 (succ && needPopStash)
new Commands.Stash(_repo.FullPath).Use(log).Pop("stash@{0}");
}
else