sourcegit/src/ViewModels/LFSPull.cs

38 lines
994 B
C#
Raw Normal View History

using System.Collections.Generic;
using System.Threading.Tasks;
2024-06-17 03:25:57 -07:00
namespace SourceGit.ViewModels
{
public class LFSPull : Popup
{
public List<Models.Remote> Remotes => _repo.Remotes;
public Models.Remote SelectedRemote
{
get;
set;
}
2024-06-17 03:25:57 -07:00
public LFSPull(Repository repo)
{
_repo = repo;
SelectedRemote = _repo.Remotes[0];
2024-06-17 03:25:57 -07:00
View = new Views.LFSPull() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = $"Pull LFS objects from remote ...";
return Task.Run(() =>
{
new Commands.LFS(_repo.FullPath).Pull(SelectedRemote.Name, SetProgressDescription);
2024-06-17 03:25:57 -07:00
CallUIThread(() => _repo.SetWatcherEnabled(true));
return true;
});
}
private readonly Repository _repo = null;
}
}