Documentation
¶
Overview ¶
Package init provides functionality for initializing Stackit in a Git repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindCommonlyNamedTrunk ¶
FindCommonlyNamedTrunk checks for common trunk branch names Returns the branch name if exactly one is found, empty string otherwise
Types ¶
type Config ¶ added in v0.29.0
type Config interface {
IsInitialized() bool
SetTrunk(trunk string) error
UndoStackDepth() int
LinearStacks() bool
}
Config is the repository configuration init reads and writes. The caller loads it (bootstrap/adapter) and passes it in; the action never loads config from disk itself.
type Handler ¶
type Handler interface {
// SelectTrunk prompts the user to select the trunk branch
SelectTrunk(ctx context.Context, branchNames []string, inferredTrunk string) (string, error)
// OnSuccess is called when initialization finishes
OnSuccess(ctx context.Context, result Result)
}
Handler abstracts interaction for the init action
type Result ¶ added in v0.29.0
type Result struct {
// Trunk is the configured trunk branch.
Trunk string
// WasInitialized reports whether stackit was already initialized.
WasInitialized bool
// Reset reports whether all branches were untracked.
Reset bool
}
Result describes a completed initialization.
Click to show internal directories.
Click to hide internal directories.