-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathPruneRemote.cs
37 lines (31 loc) · 934 Bytes
/
PruneRemote.cs
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;
namespace SourceGit.ViewModels
{
public class PruneRemote : Popup
{
public Models.Remote Remote
{
get;
}
public PruneRemote(Repository repo, Models.Remote remote)
{
_repo = repo;
Remote = remote;
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = "Run `prune` on remote ...";
var log = _repo.CreateLog($"Prune Remote '{Remote.Name}'");
Use(log);
return Task.Run(() =>
{
var succ = new Commands.Remote(_repo.FullPath).Use(log).Prune(Remote.Name);
log.Complete();
CallUIThread(() => _repo.SetWatcherEnabled(true));
return succ;
});
}
private readonly Repository _repo = null;
}
}