worktreelayout

package
v0.181.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalCoordinates

func CanonicalCoordinates(projectsRoot, root string) (host, owner, name string, err error)

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

func ResolveCanonicalClone(projectsRoot string, address repopath.Address) (repopath.Address, error)

ResolveCanonicalClone honors a specified host and otherwise locates an existing clone, leaving unqualified missing coordinates at the legacy path.

func SplitCloneRelative

func SplitCloneRelative(relative string) (parent, repository string)

SplitCloneRelative splits a clone address without validating it. It retains the legacy trim behavior used by callers with already resolved placements.

func SplitRepository

func SplitRepository(repository string) (owner, name string, err error)

SplitRepository validates a coordinate and returns its owner and name.

func SplitRepositoryAddress

func SplitRepositoryAddress(repository string) (repopath.Address, error)

SplitRepositoryAddress accepts the legacy two-level coordinate or a literal forge-host coordinate. Surrounding whitespace is never silently trimmed.

func ValidCloneRelative

func ValidCloneRelative(relative string) bool

ValidCloneRelative accepts exactly owner/repository or host/owner/repository.

func ValidRepositorySegment

func ValidRepositorySegment(value string) bool

ValidRepositorySegment also accepts a leading dot for a repository name.

func ValidSafeSegment

func ValidSafeSegment(value string) bool

ValidSafeSegment accepts an owner or task segment without a leading dot.

Types

This section is empty.

Jump to

Keyboard shortcuts

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