Add worktree integration tests

This commit is contained in:
Jesse Duffield 2023-07-17 22:03:51 +10:00
parent 18a508b29c
commit 277142fc4b
12 changed files with 385 additions and 18 deletions

View file

@ -254,6 +254,13 @@ func (self *Shell) Init() *Shell {
return self
}
func (self *Shell) AddWorktree(base string, path string, newBranchName string) *Shell {
return self.RunCommand([]string{
"git", "worktree", "add", "-b",
newBranchName, path, base,
})
}
func (self *Shell) MakeExecutable(path string) *Shell {
// 0755 sets the executable permission for owner, and read/execute permissions for group and others
err := os.Chmod(filepath.Join(self.dir, path), 0o755)