cli

package
v1.30.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFromBranch

func CreateFromBranch(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, branchName, worktreeName string, withChange, silent bool) (string, error)

CreateFromBranch creates a worktree from a branch name.

func CreateFromBranchWithFS added in v1.30.0

func CreateFromBranchWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, branchName, worktreeName string, withChange, silent bool, fs OSFilesystem) (string, error)

CreateFromBranchWithFS creates a worktree from a branch name using the provided filesystem.

func CreateFromPR

func CreateFromPR(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, prNumber int, silent bool) (string, error)

CreateFromPR creates a worktree from a PR number.

func CreateFromPRWithFS added in v1.30.0

func CreateFromPRWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, prNumber int, silent bool, fs OSFilesystem) (string, error)

CreateFromPRWithFS creates a worktree from a PR number using the provided filesystem.

func DeleteWorktree

func DeleteWorktree(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, worktreePath string, deleteBranch, silent bool) error

DeleteWorktree deletes a worktree. If worktreePath is empty, lists available worktrees.

Types

type OSFilesystem added in v1.30.0

type OSFilesystem interface {
	Stat(name string) (os.FileInfo, error)
	MkdirAll(path string, perm os.FileMode) error
	Getwd() (string, error)
}

OSFilesystem abstracts filesystem operations for dependency injection.

var DefaultFS OSFilesystem = RealFilesystem{}

DefaultFS is the default filesystem implementation using the real os package.

type RealFilesystem added in v1.30.0

type RealFilesystem struct{}

RealFilesystem implements OSFilesystem using the real os package.

func (RealFilesystem) Getwd added in v1.30.0

func (RealFilesystem) Getwd() (string, error)

Getwd wraps os.Getwd.

func (RealFilesystem) MkdirAll added in v1.30.0

func (RealFilesystem) MkdirAll(path string, perm os.FileMode) error

MkdirAll wraps os.MkdirAll.

func (RealFilesystem) Stat added in v1.30.0

func (RealFilesystem) Stat(name string) (os.FileInfo, error)

Stat wraps os.Stat.

Jump to

Keyboard shortcuts

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