sourcegit/src/ViewModels/DropStash.cs
2025-04-19 11:14:19 +08:00

32 lines
749 B
C#

using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class DropStash : Popup
{
public Models.Stash Stash { get; }
public DropStash(Repository repo, Models.Stash stash)
{
_repo = repo;
Stash = stash;
}
public override Task<bool> Sure()
{
ProgressDescription = $"Dropping stash: {Stash.Name}";
var log = _repo.CreateLog("Drop Stash");
Use(log);
return Task.Run(() =>
{
new Commands.Stash(_repo.FullPath).Use(log).Drop(Stash.Name);
log.Complete();
return true;
});
}
private readonly Repository _repo;
}
}