embedded

package
v0.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package embedded provides the pure-Go go-git backend for the git module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend implements the git interfaces using go-git.

func Clone

func Clone(ctx context.Context, url, path string, cfg *model.OpenOptions) (*Backend, error)

Clone clones a repository into path. The context bounds the remote transfer.

func Discover

func Discover(path string, cfg *model.OpenOptions) (*Backend, error)

Discover finds a git repository by walking up from the given path.

func Init

func Init(path string, cfg *model.OpenOptions) (*Backend, error)

Init creates a new git repository at the given path.

func InitBare

func InitBare(path string, cfg *model.OpenOptions) (*Backend, error)

InitBare creates a new bare git repository at the given path.

func Open

func Open(path string, cfg *model.OpenOptions) (*Backend, error)

Open opens a git repository at the given path.

func (*Backend) Blame

func (b *Backend) Blame(revision, path string, opts ...model.BlameOption) ([]model.BlameLine, error)

Blame returns line-level attribution for a file at a revision.

func (*Backend) Commit

func (b *Backend) Commit(message string, opts ...model.CommitOption) (model.Oid, error)

Commit creates a new commit from the current index state.

func (*Backend) ConfigGet

func (b *Backend) ConfigGet(key string) (string, error)

ConfigGet gets the last configured value for a key.

func (*Backend) ConfigGetAll

func (b *Backend) ConfigGetAll(key string) ([]string, error)

ConfigGetAll gets all configured values for a key.

func (*Backend) ConfigSet

func (b *Backend) ConfigSet(key, value string) error

ConfigSet sets a config key to a single value.

func (*Backend) CreateBranch

func (b *Backend) CreateBranch(name, target string) error

CreateBranch creates a local branch at target.

func (*Backend) CreateSignedTag

func (b *Backend) CreateSignedTag(name, target, message string, opts model.SignOptions) error

CreateSignedTag is unsupported by go-git; Repo routes signed tags to the CLI backend.

func (*Backend) CreateTag

func (b *Backend) CreateTag(name, target, message string) error

CreateTag creates a lightweight or annotated tag at target.

func (*Backend) DeleteBranch

func (b *Backend) DeleteBranch(name string) error

DeleteBranch deletes a local branch.

func (*Backend) DeleteTag

func (b *Backend) DeleteTag(name string) error

DeleteTag deletes a tag.

func (*Backend) Diff

func (b *Backend) Diff(from, to string) ([]model.DiffEntry, error)

Diff returns file changes between two refs.

func (*Backend) DiffStats

func (b *Backend) DiffStats(from, to string) (model.DiffStats, error)

DiffStats returns aggregated statistics for changes between two refs.

func (*Backend) Fetch

func (b *Backend) Fetch(ctx context.Context, remote string, opts ...model.FetchOption) error

Fetch fetches updates from a remote. The context bounds the remote transfer.

func (*Backend) FileAt

func (b *Backend) FileAt(revision, path string) ([]byte, error)

FileAt returns the content of a file at the given revision and path.

func (*Backend) FileAtBounded

func (b *Backend) FileAtBounded(revision, path string, maxBytes int64) ([]byte, error)

FileAtBounded returns file content only when the blob fits maxBytes.

func (*Backend) Head

func (b *Backend) Head() (model.Reference, error)

Head returns the reference that HEAD points to.

func (*Backend) IsAncestor

func (b *Backend) IsAncestor(a, other string) (bool, error)

IsAncestor reports whether a is an ancestor of b.

func (*Backend) IsDirty

func (b *Backend) IsDirty() (bool, error)

IsDirty reports whether the working tree has uncommitted changes.

func (*Backend) ListBranches

func (b *Backend) ListBranches(filter model.BranchFilter) ([]model.Branch, error)

ListBranches lists repository branches matching filter.

func (*Backend) ListEntries

func (b *Backend) ListEntries(revision, path string) ([]model.TreeEntry, error)

ListEntries returns the entries in a tree at the given revision and path.

func (*Backend) ListRemotes

func (b *Backend) ListRemotes() ([]model.Remote, error)

ListRemotes lists configured remotes.

func (*Backend) ListTags

func (b *Backend) ListTags() ([]model.Tag, error)

ListTags lists repository tags.

func (*Backend) Log

func (b *Backend) Log(opts model.LogOptions) ([]model.Commit, error)

Log returns commits reachable from HEAD that match the provided filters.

func (*Backend) MergeBase

func (b *Backend) MergeBase(a, other string) (model.Oid, error)

MergeBase returns a merge base for a and b.

func (*Backend) Push

func (b *Backend) Push(ctx context.Context, remote string, opts ...model.PushOption) error

Push pushes updates to a remote. The context bounds the remote transfer.

func (*Backend) ResolveRef

func (b *Backend) ResolveRef(refname string) (model.Oid, error)

ResolveRef resolves a ref name to an OID.

func (*Backend) Root

func (b *Backend) Root() string

Root returns the absolute path to the repository root.

func (*Backend) Stage

func (b *Backend) Stage(paths ...string) error

Stage adds the provided paths to the repository index.

func (*Backend) StagedEntries

func (b *Backend) StagedEntries() ([]model.StatusEntry, error)

StagedEntries returns staged files from the repository index.

func (*Backend) Status

func (b *Backend) Status() ([]model.StatusEntry, error)

Status returns the working tree status.

func (*Backend) TrackingBranch

func (b *Backend) TrackingBranch(branch string) (string, error)

TrackingBranch returns the configured upstream for a local branch.

func (*Backend) TreeHash

func (b *Backend) TreeHash(revision, path string) (model.TreeHash, error)

TreeHash returns the OID of the tree at the given path and revision.

func (*Backend) Unstage

func (b *Backend) Unstage(paths ...string) error

Unstage removes the provided paths from the repository index while preserving worktree changes.

Jump to

Keyboard shortcuts

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