mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-14 11:23:09 +02:00
18 lines
403 B
Go
18 lines
403 B
Go
|
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()
|
||
|
}
|