Help us shape the future of Go! Take the 2026 Go Developer Survey

untrack

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package untrack implements the stackit untrack command for stopping branch tracking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx context.Context, deps Deps, opts Options, handler Handler) error

Action performs the untrack operation

Types

type Deps added in v0.30.1

type Deps struct {
	Engine Engine
	Out    output.Output
}

Deps are the collaborators untrack needs. Adapters build them from their own runtime state; the action never sees bootstrap types.

type Engine added in v0.30.1

type Engine interface {
	engine.BranchLookup
	Graph(ctx context.Context, strategy engine.SortStrategy) *engine.StackGraph
	UntrackBranches(ctx context.Context, branchNames []string) error
}

Engine lists exactly the engine methods untrack calls.

type Handler

type Handler interface {
	// PromptConfirmUntrackDescendants prompts user to confirm untracking descendants
	// Returns true to proceed with untracking all descendants, false to cancel
	PromptConfirmUntrackDescendants(branchName string, descendantCount int) (bool, 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 untrack action

type NullHandler

type NullHandler struct {
	handler.NullBase
}

NullHandler is a no-op handler for when nil is passed

func (*NullHandler) PromptConfirmUntrackDescendants

func (h *NullHandler) PromptConfirmUntrackDescendants(_ string, _ int) (bool, error)

PromptConfirmUntrackDescendants implements Handler. Returns false (cancel) for null handler. Use --force flag to untrack descendants without confirmation.

type Options

type Options struct {
	BranchName string
	Force      bool
}

Options contains options for the untrack command

Jump to

Keyboard shortcuts

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