Documentation
¶
Overview ¶
Package embedded provides the pure-Go go-git backend for the git module.
Index ¶
- type Backend
- func Clone(ctx context.Context, url, path string, cfg *model.OpenOptions) (*Backend, error)
- func Discover(path string, cfg *model.OpenOptions) (*Backend, error)
- func Init(path string, cfg *model.OpenOptions) (*Backend, error)
- func InitBare(path string, cfg *model.OpenOptions) (*Backend, error)
- func Open(path string, cfg *model.OpenOptions) (*Backend, error)
- func (b *Backend) Blame(revision, path string, opts ...model.BlameOption) ([]model.BlameLine, error)
- func (b *Backend) Commit(message string, opts ...model.CommitOption) (model.Oid, error)
- func (b *Backend) ConfigGet(key string) (string, error)
- func (b *Backend) ConfigGetAll(key string) ([]string, error)
- func (b *Backend) ConfigSet(key, value string) error
- func (b *Backend) CreateBranch(name, target string) error
- func (b *Backend) CreateSignedTag(name, target, message string, opts model.SignOptions) error
- func (b *Backend) CreateTag(name, target, message string) error
- func (b *Backend) DeleteBranch(name string) error
- func (b *Backend) DeleteTag(name string) error
- func (b *Backend) Diff(from, to string) ([]model.DiffEntry, error)
- func (b *Backend) DiffStats(from, to string) (model.DiffStats, error)
- func (b *Backend) Fetch(ctx context.Context, remote string, opts ...model.FetchOption) error
- func (b *Backend) FileAt(revision, path string) ([]byte, error)
- func (b *Backend) FileAtBounded(revision, path string, maxBytes int64) ([]byte, error)
- func (b *Backend) Head() (model.Reference, error)
- func (b *Backend) IsAncestor(a, other string) (bool, error)
- func (b *Backend) IsDirty() (bool, error)
- func (b *Backend) ListBranches(filter model.BranchFilter) ([]model.Branch, error)
- func (b *Backend) ListEntries(revision, path string) ([]model.TreeEntry, error)
- func (b *Backend) ListRemotes() ([]model.Remote, error)
- func (b *Backend) ListTags() ([]model.Tag, error)
- func (b *Backend) Log(opts model.LogOptions) ([]model.Commit, error)
- func (b *Backend) MergeBase(a, other string) (model.Oid, error)
- func (b *Backend) Push(ctx context.Context, remote string, opts ...model.PushOption) error
- func (b *Backend) ResolveRef(refname string) (model.Oid, error)
- func (b *Backend) Root() string
- func (b *Backend) Stage(paths ...string) error
- func (b *Backend) StagedEntries() ([]model.StatusEntry, error)
- func (b *Backend) Status() ([]model.StatusEntry, error)
- func (b *Backend) TrackingBranch(branch string) (string, error)
- func (b *Backend) TreeHash(revision, path string) (model.TreeHash, error)
- func (b *Backend) Unstage(paths ...string) error
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 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) ConfigGetAll ¶
ConfigGetAll gets all configured values for a key.
func (*Backend) CreateBranch ¶
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) DeleteBranch ¶
DeleteBranch deletes a local branch.
func (*Backend) Fetch ¶
Fetch fetches updates from a remote. The context bounds the remote transfer.
func (*Backend) FileAtBounded ¶
FileAtBounded returns file content only when the blob fits maxBytes.
func (*Backend) IsAncestor ¶
IsAncestor reports whether a is an ancestor of b.
func (*Backend) ListBranches ¶
ListBranches lists repository branches matching filter.
func (*Backend) ListEntries ¶
ListEntries returns the entries in a tree at the given revision and path.
func (*Backend) ListRemotes ¶
ListRemotes lists configured remotes.
func (*Backend) ResolveRef ¶
ResolveRef resolves a ref name to an OID.
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 ¶
TrackingBranch returns the configured upstream for a local branch.