Documentation
¶
Overview ¶
internal/undo/undo.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSnapshot = errors.New("nothing to undo")
ErrNoSnapshot is returned when no undo snapshot exists.
Functions ¶
Types ¶
type BranchState ¶
type BranchState struct {
SHA string `json:"sha"`
StackParent string `json:"stack_parent,omitempty"`
StackPR int `json:"stack_pr,omitempty"`
StackForkPoint string `json:"stack_fork_point,omitempty"`
}
BranchState captures the state of a single branch for undo.
type Snapshot ¶
type Snapshot struct {
Timestamp time.Time `json:"timestamp"`
Operation string `json:"operation"`
Command string `json:"command"`
OriginalHead string `json:"original_head"`
StashRef string `json:"stash_ref,omitempty"`
Branches map[string]BranchState `json:"branches"`
DeletedBranches map[string]BranchState `json:"deleted_branches,omitempty"`
}
Snapshot represents the complete state before a destructive operation.
func LoadLatest ¶
LoadLatest reads the most recent snapshot from .git/stack-undo/. Returns the snapshot, its file path, and any error.
func NewSnapshot ¶
NewSnapshot creates a new snapshot with the current timestamp.
Click to show internal directories.
Click to hide internal directories.