forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssumeUnchangedManager.cs
More file actions
37 lines (31 loc) · 1.01 KB
/
Copy pathAssumeUnchangedManager.cs
File metadata and controls
37 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Threading.Tasks;
using Avalonia.Collections;
using Avalonia.Threading;
namespace SourceGit.ViewModels
{
public class AssumeUnchangedManager
{
public AvaloniaList<string> Files { get; private set; }
public AssumeUnchangedManager(Repository repo)
{
_repo = repo;
Files = new AvaloniaList<string>();
Task.Run(() =>
{
var collect = new Commands.QueryAssumeUnchangedFiles(_repo.FullPath).Result();
Dispatcher.UIThread.Invoke(() => Files.AddRange(collect));
});
}
public void Remove(string file)
{
if (!string.IsNullOrEmpty(file))
{
var log = _repo.CreateLog("Remove Assume Unchanged File");
new Commands.AssumeUnchanged(_repo.FullPath, file, false).Use(log).Exec();
log.Complete();
Files.Remove(file);
}
}
private readonly Repository _repo;
}
}