Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultWorktreeFormat = "{repo}-{branch}"
DefaultWorktreeFormat is the default format for worktree folder names
Variables ¶
View Source
var ValidPlaceholders = []string{"{repo}", "{branch}", "{folder}"}
ValidPlaceholders lists all supported placeholders
Functions ¶
func FormatWorktreeName ¶
func FormatWorktreeName(format string, params FormatParams) string
FormatWorktreeName applies the format template to generate a worktree folder name
func SanitizeForPath ¶
SanitizeForPath replaces characters that are problematic in file paths Replaces: / \ : * ? " < > | with -
func ValidateFormat ¶
ValidateFormat checks if a format string is valid Returns error if format contains unknown placeholders
Types ¶
type FormatParams ¶
type FormatParams struct {
GitOrigin string // repo name from git remote get-url origin
BranchName string // branch name as provided
FolderName string // actual folder name of git repo on disk
}
FormatParams contains the values for placeholder substitution
Click to show internal directories.
Click to hide internal directories.