git

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingRepo = errors.New("missing repo")

ErrMissingRepo indicates that the requested repository could not be found.

Functions

This section is empty.

Types

type Repo

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

Repo represents a Git repository.

func (*Repo) GetCommits added in v0.2.0

func (r *Repo) GetCommits(ref *plumbing.Reference) (gitypes.Commits, error)

GetCommits returns the commits for a repository.

func (*Repo) GetHEAD added in v0.2.2

func (r *Repo) GetHEAD() *plumbing.Reference

GetHEAD returns the reference for a repository.

func (*Repo) GetReadme added in v0.2.2

func (r *Repo) GetReadme() string

GetReadme returns the readme for a repository.

func (*Repo) GetReferences added in v0.2.2

func (r *Repo) GetReferences() []*plumbing.Reference

GetReferences returns the references for a repository.

func (*Repo) LatestFile

func (r *Repo) LatestFile(path string) (string, error)

LatestFile returns the latest file at the specified path in the repository.

func (*Repo) Name

func (r *Repo) Name() string

GetName returns the name of the repository.

func (*Repo) Repository

func (r *Repo) Repository() *git.Repository

GetRepository returns the underlying go-git repository object.

func (*Repo) SetHEAD added in v0.2.2

func (r *Repo) SetHEAD(ref *plumbing.Reference) error

SetHEAD sets the repository head reference.

func (*Repo) Tree added in v0.2.2

func (r *Repo) Tree(ref *plumbing.Reference, path string) (*object.Tree, error)

Tree returns the git tree for a given path.

type RepoSource

type RepoSource struct {
	Path string
	// contains filtered or unexported fields
}

RepoSource is a reference to an on-disk repositories.

func NewRepoSource

func NewRepoSource(repoPath string) *RepoSource

NewRepoSource creates a new RepoSource.

func (*RepoSource) AllRepos

func (rs *RepoSource) AllRepos() []*Repo

AllRepos returns all repositories for the given RepoSource.

func (*RepoSource) GetRepo

func (rs *RepoSource) GetRepo(name string) (*Repo, error)

GetRepo returns a repository by name.

func (*RepoSource) InitRepo

func (rs *RepoSource) InitRepo(name string, bare bool) (*Repo, error)

InitRepo initializes a new Git repository.

func (*RepoSource) LoadRepos

func (rs *RepoSource) LoadRepos() error

LoadRepos opens Git repositories.

Jump to

Keyboard shortcuts

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