Help us shape the future of Go! Take the 2026 Go Developer Survey

git

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = stderrors.New("file not found")

ErrNotFound is returned when a requested file does not exist in the repository.

Functions

This section is empty.

Types

type Git

type Git interface {
	WriteFile(ctx context.Context, path string, content []byte) error
	DeleteFile(ctx context.Context, path string) error
	ReadFile(ctx context.Context, path string) ([]byte, error)
	ListFiles(ctx context.Context, pattern string) ([]string, error)
	Pull(ctx context.Context) error
	Status(ctx context.Context) (Status, error)
}

Git abstracts all git shell operations on a local repository.

func New

func New(repoPath string) Git

New returns a Git implementation backed by the system git binary for the given repository path.

type Status

type Status struct {
	// Clean is true when the working tree has no uncommitted changes.
	Clean bool
	// NoPushPending is true when there are no commits ahead of the remote.
	NoPushPending bool
}

Status represents the current state of the git working tree.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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