Documentation
¶
Index ¶
- func CreateFromBranch(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, ...) (string, error)
- func CreateFromBranchWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, ...) (string, error)
- func CreateFromIssue(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, issueNumber int, ...) (string, error)
- func CreateFromIssueWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, issueNumber int, ...) (string, error)
- func CreateFromPR(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, prNumber int, ...) (string, error)
- func CreateFromPRWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, prNumber int, ...) (string, error)
- func DeleteWorktree(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, ...) error
- func FindWorktreeByPathOrName(pathOrName string, worktrees []*models.WorktreeInfo, ...) (*models.WorktreeInfo, error)
- func RenameWorktree(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, ...) error
- func SelectIssueInteractive(ctx context.Context, gitSvc gitService, stdin io.Reader, stderr io.Writer) (int, error)
- func SelectIssueInteractiveFromStdio(ctx context.Context, gitSvc gitService) (int, error)
- func SelectPRInteractive(ctx context.Context, gitSvc gitService, stdin io.Reader, stderr io.Writer) (int, error)
- func SelectPRInteractiveFromStdio(ctx context.Context, gitSvc gitService) (int, error)
- type OSFilesystem
- type RealFilesystem
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 CreateFromIssue ¶ added in v1.34.0
func CreateFromIssue(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, issueNumber int, baseBranch string, noWorkspace, silent bool) (string, error)
CreateFromIssue creates a worktree from an issue number.
func CreateFromIssueWithFS ¶ added in v1.34.0
func CreateFromIssueWithFS(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, issueNumber int, baseBranch string, noWorkspace, silent bool, fs OSFilesystem) (string, error)
CreateFromIssueWithFS creates a worktree from an issue number using the provided filesystem.
func CreateFromPR ¶
func CreateFromPR(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, prNumber int, noWorkspace, 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, noWorkspace, 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.
func FindWorktreeByPathOrName ¶ added in v1.37.0
func FindWorktreeByPathOrName(pathOrName string, worktrees []*models.WorktreeInfo, worktreeDir, repoName string) (*models.WorktreeInfo, error)
FindWorktreeByPathOrName finds a worktree by its path or name.
func RenameWorktree ¶ added in v1.37.0
func RenameWorktree(ctx context.Context, gitSvc gitService, cfg *config.AppConfig, worktreePath, newName string, silent bool) error
RenameWorktree renames a worktree. The branch is renamed only when the current worktree name and branch name are the same.
func SelectIssueInteractive ¶ added in v1.34.0
func SelectIssueInteractive(ctx context.Context, gitSvc gitService, stdin io.Reader, stderr io.Writer) (int, error)
SelectIssueInteractive presents an interactive issue selector (fzf when available, numbered list otherwise).
func SelectIssueInteractiveFromStdio ¶ added in v1.34.0
SelectIssueInteractiveFromStdio wraps SelectIssueInteractive with os.Stdin/os.Stderr.
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.