Documentation
¶
Overview ¶
Package worktreelayout owns repository-address and checkout-path grammar. It sits below the worktrees facade and reuses repopath's literal host and segment rules without importing the facade's lifecycle policy.
Index ¶
- func CanonicalCoordinates(projectsRoot, root string) (host, owner, name string, err error)
- func CanonicalRepositoryPath(projectsRoot, repository string) (owner, name, canonical string, err error)
- func Path(root string, repositoryLocal bool, cloneRelative, task, repository string) (string, error)
- func ResolveCanonicalClone(projectsRoot string, address repopath.Address) (repopath.Address, error)
- func SplitCloneRelative(relative string) (parent, repository string)
- func SplitRepository(repository string) (owner, name string, err error)
- func SplitRepositoryAddress(repository string) (repopath.Address, error)
- func ValidCloneRelative(relative string) bool
- func ValidRepositorySegment(value string) bool
- func ValidSafeSegment(value string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalCoordinates ¶
CanonicalCoordinates identifies the exact two- or three-level placement of a canonical clone below projectsRoot.
func CanonicalRepositoryPath ¶
func CanonicalRepositoryPath(projectsRoot, repository string) (owner, name, canonical string, err error)
CanonicalRepositoryPath resolves an address to its existing or predicted canonical clone path below projectsRoot.
func Path ¶
func Path(root string, repositoryLocal bool, cloneRelative, task, repository string) (string, error)
Path returns the checkout path selected by a resolved placement.
func ResolveCanonicalClone ¶
ResolveCanonicalClone honors a specified host and otherwise locates an existing clone, leaving unqualified missing coordinates at the legacy path.
func SplitCloneRelative ¶
SplitCloneRelative splits a clone address without validating it. It retains the legacy trim behavior used by callers with already resolved placements.
func SplitRepository ¶
SplitRepository validates a coordinate and returns its owner and name.
func SplitRepositoryAddress ¶
SplitRepositoryAddress accepts the legacy two-level coordinate or a literal forge-host coordinate. Surrounding whitespace is never silently trimmed.
func ValidCloneRelative ¶
ValidCloneRelative accepts exactly owner/repository or host/owner/repository.
func ValidRepositorySegment ¶
ValidRepositorySegment also accepts a leading dot for a repository name.
func ValidSafeSegment ¶
ValidSafeSegment accepts an owner or task segment without a leading dot.
Types ¶
This section is empty.