preflight

package
v3.35.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(dir string, ref string, debug bool) error

Cleanup deletes the preflight branch from the remote. If the branch no longer exists on the remote, it is treated as success.

func RepositoryRoot added in v3.35.0

func RepositoryRoot(dir string, debug bool) (string, error)

RepositoryRoot returns the top-level path for the git repository containing dir.

Types

type FileChange

type FileChange struct {
	Status string // e.g. "M", "A", "D", "R"
	Path   string
}

FileChange represents a single file changed in the snapshot.

func (FileChange) StatusSymbol

func (f FileChange) StatusSymbol() string

StatusSymbol returns a human-readable symbol for the file change status.

type SnapshotOption

type SnapshotOption func(*snapshotConfig)

SnapshotOption configures Snapshot behavior.

func WithDebug

func WithDebug() SnapshotOption

WithDebug enables verbose git output on failure.

type SnapshotResult

type SnapshotResult struct {
	Commit string
	Ref    string
	Branch string
	Files  []FileChange
}

SnapshotResult holds the output of a successful snapshot operation.

func Snapshot

func Snapshot(dir string, preflightID uuid.UUID, opts ...SnapshotOption) (*SnapshotResult, error)

Snapshot pushes the current working tree state to a remote preflight ref. It always creates a distinct commit on top of HEAD (even when the worktree is clean) without touching the real git index.

func (SnapshotResult) ShortCommit added in v3.35.0

func (r SnapshotResult) ShortCommit() string

Jump to

Keyboard shortcuts

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