Documentation
¶
Index ¶
- type Branch
- type Diff
- type Repository
- func (r *Repository) Branches() ([]*Branch, error)
- func (r *Repository) DefaultRef() string
- func (r *Repository) Diff(ref string) (*Diff, error)
- func (r *Repository) Log(n int, options *git.LogOptions) ([]*object.Commit, error)
- func (r *Repository) RevCommit(ref string) (*object.Commit, error)
- func (r *Repository) Tags() ([]*object.Tag, error)
- func (r *Repository) Updated() time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
Repository is a wrapper for go-git's Repository type.
func Open ¶
func Open(path string) (*Repository, error)
Open returns a git repository from the given path.
func (*Repository) Branches ¶
func (r *Repository) Branches() ([]*Branch, error)
Branches returns all branches sorted from the recently updated branch.
func (*Repository) DefaultRef ¶
func (r *Repository) DefaultRef() string
DefaultRef returns the reference name pointed to by HEAD, or else an empty string if not found.
func (*Repository) Diff ¶
func (r *Repository) Diff(ref string) (*Diff, error)
Diff returns the difference between the specified reference and its parent. If the parent does not exist, the patch will only have the add operation.
func (*Repository) Log ¶
func (r *Repository) Log(n int, options *git.LogOptions) ([]*object.Commit, error)
Log returns at most n commits or all of them if n < 0 with the given options. If there are no more commits, io.EOF is returned along with the list.
func (*Repository) RevCommit ¶
func (r *Repository) RevCommit(ref string) (*object.Commit, error)
RevCommit returns the commit object from the given revision.
func (*Repository) Tags ¶
func (r *Repository) Tags() ([]*object.Tag, error)
Tags returns all annotated tags sorted from the recently created tag.
func (*Repository) Updated ¶
func (r *Repository) Updated() time.Time
Updated returns the time of the latest commit.