mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-13 00:07:20 -08:00
43 lines
1 KiB
C#
43 lines
1 KiB
C#
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace SourceGit.ViewModels
|
|||
|
{
|
|||
|
public class FetchInto : Popup
|
|||
|
{
|
|||
|
public Models.Branch Local
|
|||
|
{
|
|||
|
get;
|
|||
|
private set;
|
|||
|
}
|
|||
|
|
|||
|
public Models.Branch Upstream
|
|||
|
{
|
|||
|
get;
|
|||
|
private set;
|
|||
|
}
|
|||
|
|
|||
|
public FetchInto(Repository repo, Models.Branch local, Models.Branch upstream)
|
|||
|
{
|
|||
|
_repo = repo;
|
|||
|
Local = local;
|
|||
|
Upstream = upstream;
|
|||
|
View = new Views.FetchInto() { DataContext = this };
|
|||
|
}
|
|||
|
|
|||
|
public override Task<bool> Sure()
|
|||
|
{
|
|||
|
_repo.SetWatcherEnabled(false);
|
|||
|
ProgressDescription = "Fast-Forward ...";
|
|||
|
|
|||
|
return Task.Run(() =>
|
|||
|
{
|
|||
|
new Commands.Fetch(_repo.FullPath, Local, Upstream, SetProgressDescription).Exec();
|
|||
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
|||
|
return true;
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
private readonly Repository _repo = null;
|
|||
|
}
|
|||
|
}
|