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

changes

package
v0.12.17 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("change tracker closed")
View Source
var ErrDirtyWorktree = errors.New("local changes can only move between branches at the same commit; clean the worktree before switching to a divergent branch")
View Source
var ErrNoDiff = errors.New("diff not found")
View Source
var ErrNotGitRepository = errors.New("workspace is not a Git repository")

Functions

This section is empty.

Types

type DiffLayer

type DiffLayer string
const (
	DiffCombined DiffLayer = ""
	DiffStaged   DiffLayer = "staged"
	DiffUnstaged DiffLayer = "unstaged"
)

type FileDiff

type FileDiff struct {
	Path     string
	Status   FileStatus
	Patch    string
	Original string
	Modified string
}

type FileStatus

type FileStatus int
const (
	StatusAdded FileStatus = iota
	StatusModified
	StatusDeleted
)

type GitBranch

type GitBranch struct {
	Name    string
	Remote  string
	Current bool
}

type GitFileStatus

type GitFileStatus struct {
	Path           string
	OriginalPath   string
	IndexStatus    string
	WorktreeStatus string
	Staged         bool
	Changed        bool
	Conflict       bool
}

type GitStatus

type GitStatus struct {
	Branch    string
	Upstream  string
	Ahead     int
	Behind    int
	HasRemote bool
	Files     []GitFileStatus
}

type Manager

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

func New

func New(workingDir, gitDir string, native bool) *Manager

func (*Manager) Branches

func (m *Manager) Branches(ctx context.Context, refresh bool) ([]GitBranch, string, error)

func (*Manager) CheckoutBranch

func (m *Manager) CheckoutBranch(ctx context.Context, name, remote string) error

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) Commit

func (m *Manager) Commit(ctx context.Context, message string) (string, error)

func (*Manager) CreateBranch

func (m *Manager) CreateBranch(ctx context.Context, name string) error

func (*Manager) Diff

func (m *Manager) Diff(ctx context.Context, path string, layer DiffLayer) (FileDiff, error)

func (*Manager) Diffs

func (m *Manager) Diffs(ctx context.Context) ([]FileDiff, error)

func (*Manager) Fingerprint

func (m *Manager) Fingerprint(ctx context.Context) uint64

func (*Manager) GitStatus

func (m *Manager) GitStatus(ctx context.Context) (GitStatus, error)

func (*Manager) IsNativeGit

func (m *Manager) IsNativeGit() bool

func (*Manager) Pull

func (m *Manager) Pull(ctx context.Context) (string, error)

func (*Manager) Push

func (m *Manager) Push(ctx context.Context) (string, error)

func (*Manager) Revert

func (m *Manager) Revert(ctx context.Context, path string) error

func (*Manager) Stage

func (m *Manager) Stage(ctx context.Context, paths []string) error

func (*Manager) Unstage

func (m *Manager) Unstage(ctx context.Context, paths []string) error

Jump to

Keyboard shortcuts

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