refactor: file-system watcher

- Use `System.Threading.Interlocked` to read/write data
- Use `SourceGit.Models.Watcher.LockContext` to release watcher's lock
- New way to detect file changes in submodules
- Manually update stashes after `git stash` command complete (#1760)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-09-01 17:01:08 +08:00
parent 2c96a13e25
commit cd80a55629
62 changed files with 213 additions and 250 deletions

View File

@@ -43,7 +43,7 @@ namespace SourceGit.ViewModels
public override async Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
using var lockWatcher = _repo.LockWatcher();
ProgressDescription = "Apply patch...";
var log = _repo.CreateLog("Apply Patch");
@@ -54,7 +54,6 @@ namespace SourceGit.ViewModels
.ExecAsync();
log.Complete();
_repo.SetWatcherEnabled(true);
return succ;
}