remoterepo

package
v16.8.7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	*gitalypb.Repository
	// contains filtered or unexported fields
}

Repo represents a Git repository on a different Gitaly storage

func New

func New(ctx context.Context, repo *gitalypb.Repository, pool *client.Pool) (*Repo, error)

New creates a new remote Repository from its protobuf representation.

func (*Repo) GetDefaultBranch

func (rr *Repo) GetDefaultBranch(ctx context.Context) (git.ReferenceName, error)

GetDefaultBranch returns the default branch for the remote repository. It does so by invoking `FindDefaultBranchName()`, which itself is a wrapper around `localrepo.GetDefaultBranch()`. Semantics of this function thus match the localrepo semantics.

func (*Repo) HasBranches

func (rr *Repo) HasBranches(ctx context.Context) (bool, error)

HasBranches will dial to the remote repository and check whether the repository has any branches.

func (*Repo) HeadReference added in v16.2.0

func (rr *Repo) HeadReference(ctx context.Context) (git.ReferenceName, error)

HeadReference returns the reference that HEAD points to for the remote repository.

func (*Repo) ObjectHash

func (rr *Repo) ObjectHash(ctx context.Context) (git.ObjectHash, error)

ObjectHash detects the object hash used by this particular repository.

func (*Repo) ResolveRevision

func (rr *Repo) ResolveRevision(ctx context.Context, revision git.Revision) (git.ObjectID, error)

ResolveRevision will dial to the remote repository and attempt to resolve the revision string via the gRPC interface.

Jump to

Keyboard shortcuts

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