git

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShortRef = errors.New("short SHA references are not supported")
	ErrNoRepo   = errors.New("unable to find git repo")
)

Functions

func Clone

func Clone(ctx context.Context, input GitCloneConfig) error

NewGitCloneExecutor creates an executor to clone git repos

func CloneIfRequired

func CloneIfRequired(ctx context.Context, refName plumbing.ReferenceName, input GitCloneConfig, lg *common.LoggerWrapper) (*git.Repository, error)

CloneIfRequired ...

func FindGitRef

func FindGitRef(ctx context.Context, file string) (string, error)

FindGitRef get the current git ref

func FindGitRevision

func FindGitRevision(ctx context.Context, file string) (shortSha string, sha string, err error)

FindGitRevision get the current git revision

func FindGithubRepo

func FindGithubRepo(ctx context.Context, file, githubInstance, remoteName string) (string, error)

FindGithubRepo get the repo

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Commit

func (e *Error) Commit() string

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type GitCloneConfig

type GitCloneConfig struct {
	URL   string
	Ref   string
	Dir   string
	Token string
}

Jump to

Keyboard shortcuts

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