git

package
v0.0.0-...-ac622a4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitialCommitHash = "(initial)"
)

Variables

View Source
var (
	ErrDoesNotExist  = errors.New("path does not exist")
	ErrNotDirectory  = errors.New("not a directory")
	ErrNotRepository = errors.New("not a git repository")

	ErrDotGitOpen = errors.New("attempt to open .git/ as a repository")

	ErrRepositoryHasNoCommits = errors.New("repository has no commits")
)

Functions

This section is empty.

Types

type ConflictPathStatus

type ConflictPathStatus struct {
	StateThem PathState
	StateUs   PathState
	Path      string
}

type DiffNumStat

type DiffNumStat struct {
	Paths []PathDiffNumStat
}

type MovedPathStatus

type MovedPathStatus struct {
	StateIndex PathState
	StateFS    PathState
	Path       string
	OrigPath   string
}

type ParseError

type ParseError struct {
	Errs []error
}

func (*ParseError) Error

func (e *ParseError) Error() string

type PathDiffNumStat

type PathDiffNumStat struct {
	Path         string
	AddedLines   int
	DeletedLines int
}

type PathState

type PathState byte
const (
	UnknownPathState    PathState = iota // 0
	NotChangedPathState                  // 1
	ModifiedPathState                    // 2
	AddedPathState                       // 3
	DeletedPathState                     // 4
	RenamedPathState                     // 5
	CopiedPathState                      // 6
	UpdatedPathState                     // 7
	UntrackedPathState                   // 8
	IgnoredPathState                     // 9
)

type RegularPathStatus

type RegularPathStatus struct {
	StateIndex PathState
	StateFS    PathState
	Path       string
}

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, path string) (Repo, error)

func (Repo) BranchShowCurrent

func (r Repo) BranchShowCurrent(ctx context.Context) (string, error)

func (Repo) DiffNumStatHead

func (r Repo) DiffNumStatHead(ctx context.Context) (DiffNumStat, error)

func (Repo) Path

func (r Repo) Path() string

func (Repo) RevParseHead

func (r Repo) RevParseHead(ctx context.Context) (string, error)

func (Repo) Status

func (r Repo) Status(ctx context.Context) (Status, error)

type Status

type Status struct {
	Commit   string
	Branch   string
	Upstream string
	Ahead    int
	Behind   int
	Paths    []any
}

type TokenParseError

type TokenParseError struct {
	TokenIndex int
	Token      []byte
	Err        error
}

func (TokenParseError) Error

func (e TokenParseError) Error() string

type UnknownRunError

type UnknownRunError struct {
	Res exec.Result
	Err error
}

func NewUnknownRunErr

func NewUnknownRunErr(res exec.Result, err error) *UnknownRunError

func (*UnknownRunError) Error

func (e *UnknownRunError) Error() string

type UntrackedPathStatus

type UntrackedPathStatus struct {
	Path string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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