mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
refactor: update submodules when branch status changed
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
bead749c57
commit
59e4f0d388
1 changed files with 2 additions and 6 deletions
|
@ -114,6 +114,7 @@ namespace SourceGit.Models
|
||||||
{
|
{
|
||||||
_updateBranch = 0;
|
_updateBranch = 0;
|
||||||
_updateWC = 0;
|
_updateWC = 0;
|
||||||
|
_updateSubmodules = 0;
|
||||||
|
|
||||||
if (_updateTags > 0)
|
if (_updateTags > 0)
|
||||||
{
|
{
|
||||||
|
@ -124,6 +125,7 @@ namespace SourceGit.Models
|
||||||
Task.Run(_repo.RefreshBranches);
|
Task.Run(_repo.RefreshBranches);
|
||||||
Task.Run(_repo.RefreshCommits);
|
Task.Run(_repo.RefreshCommits);
|
||||||
Task.Run(_repo.RefreshWorkingCopyChanges);
|
Task.Run(_repo.RefreshWorkingCopyChanges);
|
||||||
|
Task.Run(_repo.RefreshSubmodules);
|
||||||
Task.Run(_repo.RefreshWorktrees);
|
Task.Run(_repo.RefreshWorktrees);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,12 +180,6 @@ namespace SourceGit.Models
|
||||||
(name.StartsWith("worktrees/", StringComparison.Ordinal) && name.EndsWith("/HEAD", StringComparison.Ordinal)))
|
(name.StartsWith("worktrees/", StringComparison.Ordinal) && name.EndsWith("/HEAD", StringComparison.Ordinal)))
|
||||||
{
|
{
|
||||||
_updateBranch = DateTime.Now.AddSeconds(.5).ToFileTime();
|
_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))
|
else if (name.StartsWith("objects/", StringComparison.Ordinal) || name.Equals("index", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue