enhance: refresh submodules manually after update/de-init submodule

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-12-24 15:28:09 +08:00
parent a570951b7f
commit 83be4bd96a
4 changed files with 13 additions and 0 deletions

View File

@@ -118,6 +118,11 @@ namespace SourceGit.Models
Interlocked.Exchange(ref _updateStashes, 0);
}
public void MarkSubmodulesUpdated()
{
Interlocked.Exchange(ref _updateSubmodules, 0);
}
public void Dispose()
{
foreach (var watcher in _watchers)

View File

@@ -36,6 +36,7 @@ namespace SourceGit.ViewModels
.DeinitAsync(Submodule, false);
log.Complete();
_repo.MarkSubmodulesDirtyManually();
return succ;
}

View File

@@ -877,6 +877,12 @@ namespace SourceGit.ViewModels
RefreshStashes();
}
public void MarkSubmodulesDirtyManually()
{
_watcher?.MarkSubmodulesUpdated();
RefreshSubmodules();
}
public void MarkFetched()
{
_lastFetchTime = DateTime.Now;

View File

@@ -96,6 +96,7 @@ namespace SourceGit.ViewModels
.UpdateAsync(targets, EnableInit, EnableRecursive, EnableRemote);
log.Complete();
_repo.MarkSubmodulesDirtyManually();
return true;
}