Documentation
¶
Index ¶
- Variables
- func BranchExists(branch string) (local bool, remote bool)
- func CreateWorktree(branch, path, baseBranch string) error
- func GetRepoRoot() (string, error)
- func GetWorktreeDir(configDir string) (string, error)
- func RemoveWorktree(path string, force bool) error
- func SanitizeBranchName(branch string) string
- type Worktree
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDirtyWorktree = errors.New("worktree contains modified or untracked files")
ErrDirtyWorktree indicates the worktree contains modified or untracked files.
Functions ¶
func BranchExists ¶
BranchExists checks if a branch exists locally or remotely.
func CreateWorktree ¶
CreateWorktree creates a new worktree. If the branch exists, it uses it. Otherwise, it creates a new branch from baseBranch.
func GetRepoRoot ¶
GetRepoRoot returns the root directory of the git repository.
func GetWorktreeDir ¶
GetWorktreeDir returns the directory where worktrees should be created.
func RemoveWorktree ¶
RemoveWorktree removes a worktree.
func SanitizeBranchName ¶
SanitizeBranchName sanitizes a branch name for use as a directory name.
Types ¶
Click to show internal directories.
Click to hide internal directories.