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:
committed by
Jesse Duffield
parent
f8ba899b87
commit
afc4aedd4f
17
pkg/commands/git_commands/worktree.go
Normal file
17
pkg/commands/git_commands/worktree.go
Normal 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()
|
||||
}
|
Reference in New Issue
Block a user