1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Support for deleting a worktree

This commit is contained in:
Joel Baranick
2022-09-01 17:58:36 -07:00
committed by Jesse Duffield
parent f8ba899b87
commit afc4aedd4f
4 changed files with 84 additions and 36 deletions

View File

@ -0,0 +1,17 @@
package git_commands
type WorktreeCommands struct {
*GitCommon
}
func NewWorktreeCommands(gitCommon *GitCommon) *WorktreeCommands {
return &WorktreeCommands{
GitCommon: gitCommon,
}
}
func (self *WorktreeCommands) Delete(worktreePath string, force bool) error {
cmdArgs := NewGitCmd("worktree").Arg("remove").ArgIf(force, "-f").Arg(worktreePath).ToArgv()
return self.cmd.New(cmdArgs).Run()
}