gitstatus

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGitUnavailable = errors.New("git unavailable")

Functions

This section is empty.

Types

type Counts

type Counts struct {
	Modified  int
	Added     int
	Untracked int
	Deleted   int
	Renamed   int
	Conflict  int
}

func (Counts) Any

func (c Counts) Any() bool

type FileStatus

type FileStatus struct {
	Path     string
	RepoPath string
	Status   Status
}

type Snapshot

type Snapshot struct {
	RepoRoot string
	Branch   string
	Ahead    int
	Behind   int
	Files    map[string]FileStatus
}

func Load

func Load(ctx context.Context, workspaceRoot string, paths []string) (Snapshot, error)

func (Snapshot) Counts

func (s Snapshot) Counts() Counts

func (Snapshot) File

func (s Snapshot) File(path string) (FileStatus, bool)

type Status

type Status int
const (
	StatusClean Status = iota
	StatusModified
	StatusAdded
	StatusUntracked
	StatusDeleted
	StatusRenamed
	StatusConflict
)

func (Status) Label

func (s Status) Label() string

Jump to

Keyboard shortcuts

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