refactor: update submodules when branch status changed

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-02-10 14:28:20 +08:00
parent bead749c57
commit 59e4f0d388
No known key found for this signature in database

View file

@ -114,6 +114,7 @@ namespace SourceGit.Models
{
_updateBranch = 0;
_updateWC = 0;
_updateSubmodules = 0;
if (_updateTags > 0)
{
@ -124,6 +125,7 @@ namespace SourceGit.Models
Task.Run(_repo.RefreshBranches);
Task.Run(_repo.RefreshCommits);
Task.Run(_repo.RefreshWorkingCopyChanges);
Task.Run(_repo.RefreshSubmodules);
Task.Run(_repo.RefreshWorktrees);
}
@ -178,12 +180,6 @@ namespace SourceGit.Models
(name.StartsWith("worktrees/", StringComparison.Ordinal) && name.EndsWith("/HEAD", StringComparison.Ordinal)))
{
_updateBranch = DateTime.Now.AddSeconds(.5).ToFileTime();
lock (_lockSubmodule)
{
if (_submodules.Count > 0)
_updateSubmodules = DateTime.Now.AddSeconds(1).ToFileTime();
}
}
else if (name.StartsWith("objects/", StringComparison.Ordinal) || name.Equals("index", StringComparison.Ordinal))
{