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

rename

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: 8 Imported by: 0

Documentation

Overview

Package rename implements the rename command, which renames the current branch and updates the stack metadata referencing it.

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 renames the current branch and updates metadata

Types

type Deps

type Deps struct {
	Engine    Engine
	Out       output.Output
	Snapshots actions.Snapshots
}

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

type Engine

type Engine interface {
	validation.BranchValidationEngine
	AllBranches() engine.Branches
	UpsertPrInfo(ctx context.Context, branch engine.Branch, prInfo *engine.PrInfo) error
	RenameBranch(ctx context.Context, oldBranch, newBranch engine.Branch) error
}

Engine lists exactly the engine methods rename calls.

type Handler

type Handler interface {
	// PromptNewName asks the user for a new branch name, given the current one.
	// Implementations should return an error when prompting is not possible
	// (e.g. non-interactive mode).
	PromptNewName(currentName string) (string, error)
}

Handler supplies a new branch name interactively when one is not given on the command line. The CLI adapter implements it; the action layer does not import the TUI.

type Options

type Options struct {
	NewName string
	Force   bool
}

Options contains options for the rename command

Jump to

Keyboard shortcuts

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