sourcegit/src/ViewModels/LFSFetch.cs
leo 8b39df32cc
feature: git command logs
Signed-off-by: leo <longshuang@msn.cn>
2025-04-17 13:23:56 +08:00

42 lines
1.1 KiB
C#

using System.Collections.Generic;
using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class LFSFetch : Popup
{
public List<Models.Remote> Remotes => _repo.Remotes;
public Models.Remote SelectedRemote
{
get;
set;
}
public LFSFetch(Repository repo)
{
_repo = repo;
SelectedRemote = _repo.Remotes[0];
View = new Views.LFSFetch() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = $"Fetching LFS objects from remote ...";
var log = _repo.CreateLog("LFS Fetch");
Use(log);
return Task.Run(() =>
{
new Commands.LFS(_repo.FullPath).Fetch(SelectedRemote.Name, log);
log.Complete();
CallUIThread(() => _repo.SetWatcherEnabled(true));
return true;
});
}
private readonly Repository _repo = null;
}
}