worktree

package
v0.1.47 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchName

func BranchName(name string) string

func CanonicalRepoRoot

func CanonicalRepoRoot(cwd string) (string, error)

func CheckoutRoot

func CheckoutRoot(cwd string) (string, error)

func FlattenName

func FlattenName(name string) string

func ValidateManagedName

func ValidateManagedName(name string) error

func ValidateName

func ValidateName(name string) error

func WorktreePath

func WorktreePath(repoRoot, name string) string

Types

type ChangeSummary added in v0.1.18

type ChangeSummary struct {
	ChangedFiles int
	IgnoredFiles int
	Commits      int
}

func CountChanges added in v0.1.18

func CountChanges(path, originalWorkspace, originalHeadCommit string) (ChangeSummary, error)

type Entry

type Entry struct {
	Name    string
	Path    string
	Branch  string
	Head    string
	Dirty   bool
	Missing bool
}

func List

func List(cwd string) ([]Entry, error)

func Status

func Status(cwd, name string) (Entry, error)

type RemoveResult

type RemoveResult struct {
	Entry         Entry
	BranchDeleted bool
	BranchWarning string
}

func Remove

func Remove(cwd, name string, force bool) (RemoveResult, error)

type Session

type Session struct {
	Name               string
	Path               string
	Branch             string
	OriginalWorkspace  string
	OriginalBranch     string
	OriginalHeadCommit string
	Created            bool
}

func Start

func Start(cwd, name string) (Session, error)

Jump to

Keyboard shortcuts

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