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