Handle deleting branch attached to worktree

This commit is contained in:
Jesse Duffield 2023-07-16 17:52:07 +10:00
parent 4b3c9f5b35
commit 6b4a638415
6 changed files with 107 additions and 40 deletions

View file

@ -49,6 +49,13 @@ func (self *GitCommandBuilder) RepoPath(value string) *GitCommandBuilder {
return self
}
func (self *GitCommandBuilder) WorktreePath(path string) *GitCommandBuilder {
// worktree path comes before the command
self.args = append([]string{"--work-tree", path}, self.args...)
return self
}
func (self *GitCommandBuilder) ToArgv() []string {
return append([]string{"git"}, self.args...)
}