mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-21 10:25:00 +00:00
41 lines
1,017 B
C#
41 lines
1,017 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SourceGit.ViewModels
|
|
{
|
|
public class LFSPush : Popup
|
|
{
|
|
public List<Models.Remote> Remotes => _repo.Remotes;
|
|
|
|
public Models.Remote SelectedRemote
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public LFSPush(Repository repo)
|
|
{
|
|
_repo = repo;
|
|
SelectedRemote = _repo.Remotes[0];
|
|
}
|
|
|
|
public override Task<bool> Sure()
|
|
{
|
|
_repo.SetWatcherEnabled(false);
|
|
ProgressDescription = $"Push LFS objects to remote ...";
|
|
|
|
var log = _repo.CreateLog("LFS Push");
|
|
Use(log);
|
|
|
|
return Task.Run(() =>
|
|
{
|
|
new Commands.LFS(_repo.FullPath).Push(SelectedRemote.Name, log);
|
|
log.Complete();
|
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
|
return true;
|
|
});
|
|
}
|
|
|
|
private readonly Repository _repo = null;
|
|
}
|
|
}
|