gitiles_common

package
v0.0.0-...-65468f9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitilesRepo

type GitilesRepo struct {
	gitiles.GitilesRepo
	// contains filtered or unexported fields
}

GitilesRepo provides helpers for dealing with repos which use Gitiles.

func NewGitilesRepo

func NewGitilesRepo(ctx context.Context, c *config.GitilesConfig, reg *config_vars.Registry, client *http.Client) (*GitilesRepo, error)

NewGitilesRepo returns a GitilesRepo instance.

func (*GitilesRepo) Branch

func (r *GitilesRepo) Branch() string

Branch returns the resolved name of the branch tracked by this GitilesRepo.

func (*GitilesRepo) ConvertRevisions

func (r *GitilesRepo) ConvertRevisions(ctx context.Context, commits []*vcsinfo.LongCommit) ([]*revision.Revision, error)

ConvertRevisions converts the given slice of LongCommits to Revisions.

func (*GitilesRepo) GetFile

func (r *GitilesRepo) GetFile(ctx context.Context, file, ref string) (string, error)

GetFile retrieves the contents of the given file at the given ref.

func (*GitilesRepo) GetRevision

func (r *GitilesRepo) GetRevision(ctx context.Context, id string) (*revision.Revision, error)

GetRevision returns a revision.Revision instance associated with the given revision ID, which may be a commit hash or fully-qualified ref name.

func (*GitilesRepo) GetTipRevision

func (r *GitilesRepo) GetTipRevision(ctx context.Context) (*revision.Revision, error)

GetTipRevision returns a revision.Revision instance associated with the current tip of the branch tracked by this GitilesRepo.

func (*GitilesRepo) LogRevisions

func (r *GitilesRepo) LogRevisions(ctx context.Context, from, to *revision.Revision) ([]*revision.Revision, error)

LogRevisions implements the child.Child interface.

func (*GitilesRepo) VFS

func (r *GitilesRepo) VFS(ctx context.Context, rev *revision.Revision) (vfs.FS, error)

VFS implements the child.Child interface.

Jump to

Keyboard shortcuts

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