Minga.Mode.BranchDeleteConfirmState (Minga v0.1.0)

Copy Markdown View Source

FSM state for confirming git branch deletion.

Holds the git root, branch name, and whether the prompt is the initial safe delete or the force-delete fallback after git reports unmerged commits.

Summary

Functions

Creates a new branch delete confirmation state.

Transitions to the force-delete confirmation prompt.

Types

phase()

@type phase() :: :delete | :force

t()

@type t() :: %Minga.Mode.BranchDeleteConfirmState{
  count: non_neg_integer() | nil,
  git_root: String.t(),
  name: String.t(),
  phase: phase(),
  reason: String.t() | nil
}

Functions

new(git_root, name)

@spec new(String.t(), String.t()) :: t()

Creates a new branch delete confirmation state.

to_force(state, reason)

@spec to_force(t(), String.t()) :: t()

Transitions to the force-delete confirmation prompt.