mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-25 11:24:02 +08:00
32 lines
727 B
C#
32 lines
727 B
C#
using System.Threading.Tasks;
|
|
|
|
namespace SourceGit.ViewModels
|
|
{
|
|
public class PruneWorktrees : Popup
|
|
{
|
|
public PruneWorktrees(Repository repo)
|
|
{
|
|
_repo = repo;
|
|
}
|
|
|
|
public override async Task<bool> Sure()
|
|
{
|
|
_repo.SetWatcherEnabled(false);
|
|
ProgressDescription = "Prune worktrees ...";
|
|
|
|
var log = _repo.CreateLog("Prune Worktrees");
|
|
Use(log);
|
|
|
|
await new Commands.Worktree(_repo.FullPath)
|
|
.Use(log)
|
|
.PruneAsync();
|
|
|
|
log.Complete();
|
|
_repo.SetWatcherEnabled(true);
|
|
return true;
|
|
}
|
|
|
|
private readonly Repository _repo = null;
|
|
}
|
|
}
|