gitstatus

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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