Documentation
¶
Overview ¶
Package navigation implements the stackit top/bottom commands for navigating stacked branches.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenThroughAnchors ¶ added in v0.27.0
FlattenThroughAnchors replaces worktree anchor branches with their non-anchor children.
Types ¶
type Deps ¶ added in v0.30.1
type Deps struct {
Engine Engine
Out output.Output
// Log, Quiet and Here pass through to the checkout of the target branch.
Log output.Logger
Quiet bool
Here actions.Here
}
Deps are the collaborators navigation needs. Adapters build them from their own runtime state; the action never sees bootstrap types.
type Engine ¶ added in v0.30.1
Engine lists exactly the engine methods navigation calls, including those of the checkout it finishes with.
type Handler ¶
type Handler interface {
// PromptSelectBranch prompts user to select a branch when multiple children exist
// Returns the selected branch name
PromptSelectBranch(message string, branches []string) (string, error)
// Cleanup restores terminal state (may be no-op)
Cleanup()
// IsInteractive returns true if the handler supports interactive prompts
IsInteractive() bool
}
Handler receives events from navigation action
type NullHandler ¶
NullHandler is a no-op handler for when nil is passed. It embeds handler.NullBase for Cleanup() and IsInteractive().
func (*NullHandler) PromptSelectBranch ¶
func (h *NullHandler) PromptSelectBranch(string, []string) (string, error)
PromptSelectBranch implements Handler. Returns empty string for null handler.