forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckout.cs
More file actions
35 lines (30 loc) · 881 Bytes
/
Copy pathCheckout.cs
File metadata and controls
35 lines (30 loc) · 881 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
using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class Checkout : Popup
{
public string Branch
{
get;
private set;
}
public Checkout(Repository repo, string branch)
{
_repo = repo;
Branch = branch;
View = new Views.Checkout() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = $"Checkout '{Branch}' ...";
return Task.Run(() =>
{
var succ = new Commands.Checkout(_repo.FullPath).Branch(Branch, SetProgressDescription);
CallUIThread(() => _repo.SetWatcherEnabled(true));
return succ;
});
}
private readonly Repository _repo;
}
}