gitutil

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Branches

func Branches(repo *git.Repository) ([]*plumbing.Reference, error)

Branches returns a list of all repository branches.

func Find

func Find(repo *git.Repository, ref *plumbing.Reference, path string) (object.Object, error)

Find returns a tree or blob from the given repo at the given ref and path.

func HeadOrDefault

func HeadOrDefault(repo *git.Repository) (*plumbing.Reference, error)

HeadOrDefault returns the head or default branch for the repo.

func Init

func Init(ctx context.Context, ds ipld.DAGService) (ipld.Node, error)

Init initializes a new repository and returns its unixfs node.

func Logs

func Logs(repo *git.Repository, ref *plumbing.Reference, offset, max int) ([]*object.Commit, error)

Logs returns a list of commits from the repo head.

func Open

func Open(ctx context.Context, ds ipld.DAGService, id string) (*git.Repository, error)

Open returns the git repository with the given CID.

func Readme

func Readme(repo *git.Repository, ref *plumbing.Reference) (*object.Blob, error)

Readme returns the readme blob object if one exists.

func RefPath

func RefPath(repo *git.Repository, path string) (*plumbing.Reference, string, error)

RefPath splits a path into the ref and path parts.

func Tags

func Tags(repo *git.Repository) ([]*plumbing.Reference, error)

Tags returns a list of all repository tags.

Types

This section is empty.

Jump to

Keyboard shortcuts

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