Documentation
¶
Index ¶
- func BranchSanitize(branch string) string
- func CopyEnvFiles(src, dst string) error
- func CurrentBranch(r *Runner) (string, error)
- func GetLocalIdentity(r *Runner, dir string) (name, email string, err error)
- func GitOnlyStatus(path string) string
- func IsGitRepo(path string) bool
- func IsInsideWorktree(r *Runner, path string) bool
- func MainWorktreePath(r *Runner) (string, error)
- func RepoName(r *Runner) (string, error)
- func SetLocalIdentity(r *Runner, dir, name, email string) error
- func ShortStatus(path string) string
- type Runner
- type Worktree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchSanitize ¶
BranchSanitize transforms a branch name into a git-safe identifier: 1. Replace '/' with '-' 2. Remove chars not in [a-zA-Z0-9_.-] 3. Collapse consecutive '-' into single '-' 4. Trim leading/trailing '-'
func CopyEnvFiles ¶
CopyEnvFiles copies .env* files from src to dst recursively. Skips .git, node_modules, and other common non-project directories.
func CurrentBranch ¶
CurrentBranch returns the name of the current git branch.
func GetLocalIdentity ¶
GetLocalIdentity reads user.name and user.email from the git config in dir.
func GitOnlyStatus ¶
func IsInsideWorktree ¶
IsInsideWorktree returns true if path is a linked worktree (not the main worktree).
func MainWorktreePath ¶
MainWorktreePath returns the path of the main worktree by parsing `git worktree list --porcelain`.
func SetLocalIdentity ¶
SetLocalIdentity sets user.name and user.email in the local git config of dir.
func ShortStatus ¶
ShortStatus returns a compact status string for the given repo path.