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

31 lines
775 B
C#

using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class PruneWorktrees : Popup
{
public PruneWorktrees(Repository repo)
{
_repo = repo;
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = "Prune worktrees ...";
var log = _repo.CreateLog("Prune Worktrees");
Use(log);
return Task.Run(() =>
{
new Commands.Worktree(_repo.FullPath).Use(log).Prune();
log.Complete();
CallUIThread(() => _repo.SetWatcherEnabled(true));
return true;
});
}
private readonly Repository _repo = null;
}
}