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 Manager
- func (m *Manager) Add(path string, branch string, createBranch bool) error
- func (m *Manager) BranchExists(branch string) (bool, error)
- func (m *Manager) Exists(pathOrBranch string) (*Worktree, error)
- func (m *Manager) FetchBranch(branch string) error
- func (m *Manager) FindWorktree(identifier string) (*Worktree, error)
- func (m *Manager) GetMainWorktreePath() (string, error)
- func (m *Manager) GetRepoName() (string, error)
- func (m *Manager) GetRepoRoot() (string, error)
- func (m *Manager) List() ([]Worktree, error)
- func (m *Manager) ListBranches() ([]string, error)
- func (m *Manager) RemoteBranchExists(branch string) (bool, error)
- func (m *Manager) Remove(path string, force bool) error
- func (m *Manager) WorktreePath(repoName, branch string) (string, error)
- type Worktree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchExists ¶
BranchExists is a package-level wrapper for backward compatibility
func BranchToSuffix ¶
BranchToSuffix converts a branch name to a directory suffix e.g., "feature/hoge" -> "feature-hoge"
func FetchBranch ¶
FetchBranch is a package-level wrapper for backward compatibility
func GetMainWorktreePath ¶
GetMainWorktreePath is a package-level wrapper for backward compatibility
func GetRepoName ¶
GetRepoName is a package-level wrapper for backward compatibility
func GetRepoRoot ¶
GetRepoRoot is a package-level wrapper for backward compatibility
func ListBranches ¶
ListBranches is a package-level wrapper for backward compatibility
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 is a package-level wrapper for backward compatibility
func WorktreeDirName ¶
WorktreeDirName generates just the directory name for a worktree
func WorktreePath ¶
WorktreePath is a package-level wrapper for backward compatibility
Types ¶
type Manager ¶ added in v0.2.0
type Manager struct {
// contains filtered or unexported fields
}
Manager manages git operations with dependency injection
func NewManager ¶ added in v0.2.0
NewManager creates a new Manager with the given executor
func (*Manager) BranchExists ¶ added in v0.2.0
BranchExists checks if a branch exists
func (*Manager) Exists ¶ added in v0.2.0
Exists checks if a worktree exists for the given path or branch
func (*Manager) FetchBranch ¶ added in v0.2.0
FetchBranch fetches a branch from origin
func (*Manager) FindWorktree ¶ added in v0.2.0
FindWorktree finds a worktree by various identifier formats
func (*Manager) GetMainWorktreePath ¶ added in v0.2.0
GetMainWorktreePath returns the path to the main (bare) worktree
func (*Manager) GetRepoName ¶ added in v0.2.0
GetRepoName returns the name of the repository (directory name)
func (*Manager) GetRepoRoot ¶ added in v0.2.0
GetRepoRoot returns the root directory of the git repository
func (*Manager) ListBranches ¶ added in v0.2.0
ListBranches returns all local and remote branches
func (*Manager) RemoteBranchExists ¶ added in v0.2.0
RemoteBranchExists checks if a remote branch exists