Documentation
¶
Index ¶
- func Add(path string, branch string, createBranch bool) error
- func BranchExists(branch string) (bool, error)
- func BranchToSuffix(branch string) string
- func FetchBranch(branch string) error
- func GetMainWorktreePath() (string, error)
- func GetRepoName() (string, error)
- func GetRepoRoot() (string, error)
- func ListBranches() ([]string, error)
- func ParseWorktreeIdentifier(identifier string, repoName string) string
- func RemoteBranchExists(branch string) (bool, error)
- func Remove(path string, force bool) error
- func WorktreeDirName(repoName, branch string) string
- func WorktreePath(repoName, branch string) (string, error)
- type Worktree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchExists ¶
BranchExists checks if a branch exists
func BranchToSuffix ¶
BranchToSuffix converts a branch name to a directory suffix e.g., "feature/hoge" -> "feature-hoge"
func GetMainWorktreePath ¶
GetMainWorktreePath returns the path to the main (bare) worktree
func GetRepoName ¶
GetRepoName returns the name of the repository (directory name)
func GetRepoRoot ¶
GetRepoRoot returns the root directory of the git repository
func ListBranches ¶
ListBranches returns all local and remote branches
func ParseWorktreeIdentifier ¶
ParseWorktreeIdentifier parses various forms of worktree identifier and returns the matching worktree if found Supported formats:
- branch name: "feature/hoge"
- suffix: "feature-hoge"
- full dir name: "ex-repo-feature-hoge"
- full path: "/path/to/ex-repo-feature-hoge"
func RemoteBranchExists ¶
RemoteBranchExists checks if a remote branch exists
func WorktreeDirName ¶
WorktreeDirName generates just the directory name for a worktree
func WorktreePath ¶
WorktreePath generates the worktree directory path e.g., for repo "ex-repo" and branch "feature/hoge" -> "../ex-repo-feature-hoge"