mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-22 05:40:43 +08:00
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:
@@ -113,7 +113,7 @@ namespace SourceGit.ViewModels
|
||||
|
||||
public override async Task<bool> Sure()
|
||||
{
|
||||
_repo.SetWatcherEnabled(false);
|
||||
using var lockWatcher = _repo.LockWatcher();
|
||||
|
||||
var log = _repo.CreateLog("Pull");
|
||||
Use(log);
|
||||
@@ -133,7 +133,6 @@ namespace SourceGit.ViewModels
|
||||
if (!succ)
|
||||
{
|
||||
log.Complete();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -163,7 +162,6 @@ namespace SourceGit.ViewModels
|
||||
|
||||
var head = await new Commands.QueryRevisionByRefName(_repo.FullPath, "HEAD").GetResultAsync();
|
||||
_repo.NavigateToCommit(head, true);
|
||||
_repo.SetWatcherEnabled(true);
|
||||
return rs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user