Support fastforwarding worktree

This commit is contained in:
Jesse Duffield 2023-07-24 17:16:59 +10:00
parent a313b16704
commit b3060065d9
6 changed files with 107 additions and 4 deletions

View file

@ -261,6 +261,13 @@ func (self *Shell) AddWorktree(base string, path string, newBranchName string) *
})
}
// add worktree and have it checkout the base branch
func (self *Shell) AddWorktreeCheckout(base string, path string) *Shell {
return self.RunCommand([]string{
"git", "worktree", "add", path, base,
})
}
func (self *Shell) AddFileInWorktree(worktreePath string) *Shell {
self.CreateFile(filepath.Join(worktreePath, "content"), "content")