utils

package
v1.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDirPerms = 0o750

DefaultDirPerms defines directory permissions for created paths.

Variables

This section is empty.

Functions

func ExpandPath

func ExpandPath(path string) (string, error)

ExpandPath expands ~ and environment variables in a path.

func GenerateIssueWorktreeName

func GenerateIssueWorktreeName(issue *models.IssueInfo, template, generatedTitle string) string

GenerateIssueWorktreeName generates a worktree name from an issue using a template. Supports placeholders: {number}, {title}, {generated}

func GeneratePRWorktreeName

func GeneratePRWorktreeName(pr *models.PRInfo, template, generatedTitle string) string

GeneratePRWorktreeName generates a worktree name from a PR using a template. Supports placeholders: {number}, {title}, {generated}, {pr_author}

func SanitizeBranchName

func SanitizeBranchName(name string, maxLength int) string

SanitizeBranchName sanitizes a branch/title for use as a worktree directory name. - Converts to lowercase - Keeps only alphanumeric characters, replaces everything else with hyphens - Collapses consecutive hyphens - Trims leading/trailing hyphens - Optionally limits length (0 = no limit)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL