forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoveWorktree.cs
More file actions
42 lines (34 loc) · 950 Bytes
/
RemoveWorktree.cs
File metadata and controls
42 lines (34 loc) · 950 Bytes
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
38
39
40
41
42
using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class RemoveWorktree : Popup
{
public Models.Worktree Target
{
get;
}
public bool Force
{
get;
set;
} = false;
public RemoveWorktree(Repository repo, Models.Worktree target)
{
_repo = repo;
Target = target;
}
public override async Task<bool> Sure()
{
using var lockWatcher = _repo.LockWatcher();
ProgressDescription = "Remove worktree ...";
var log = _repo.CreateLog("Remove worktree");
Use(log);
var succ = await new Commands.Worktree(_repo.FullPath)
.Use(log)
.RemoveAsync(Target.FullPath, Force);
log.Complete();
return succ;
}
private readonly Repository _repo = null;
}
}