git

package
v0.5.13-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommitDelimiter      string = "@sha256:"
	PullRequestReference string = "pull/([0-9]+)/head"
	SubPathDelimiter     string = "@subpath:"
)

Variables

This section is empty.

Functions

func CloneRepository added in v0.5.0

func CloneRepository(ctx context.Context, gitInfo *GitInfo, targetDir string, helper string, bare bool, cloner Cloner, writer io.Writer, log log.Logger) error

func CloneRepositoryWithEnv added in v0.5.9

func CloneRepositoryWithEnv(ctx context.Context, gitInfo *GitInfo, extraEnv []string, targetDir string, helper string, bare bool, cloner Cloner, writer io.Writer, log log.Logger) error

func CommandContext

func CommandContext(ctx context.Context, args ...string) *exec.Cmd

func GetBranchNameForPR added in v0.4.0

func GetBranchNameForPR(ref string) string

func NormalizeRepository added in v0.2.0

func NormalizeRepository(str string) (string, string, string, string, string)

func PingRepository added in v0.2.0

func PingRepository(str string) bool

Types

type CloneStrategy added in v0.5.7

type CloneStrategy string
const (
	FullCloneStrategy     CloneStrategy = ""
	BloblessCloneStrategy CloneStrategy = "blobless"
	TreelessCloneStrategy CloneStrategy = "treeless"
	ShallowCloneStrategy  CloneStrategy = "shallow"
)

func (*CloneStrategy) Set added in v0.5.7

func (s *CloneStrategy) Set(v string) error

func (*CloneStrategy) String added in v0.5.7

func (s *CloneStrategy) String() string

func (*CloneStrategy) Type added in v0.5.7

func (s *CloneStrategy) Type() string

type Cloner added in v0.5.7

type Cloner interface {
	Clone(ctx context.Context, repository string, targetDir string, extraArgs, extraEnv []string, stdout, stderr io.Writer) error
}

func NewCloner added in v0.5.7

func NewCloner(strategy CloneStrategy) Cloner

type GitInfo added in v0.5.0

type GitInfo struct {
	Repository string
	Branch     string
	Commit     string
	PR         string
	SubPath    string
}

func NewGitInfo added in v0.5.0

func NewGitInfo(repository, branch, commit, pr, subpath string) *GitInfo

func NormalizeRepositoryGitInfo added in v0.5.0

func NormalizeRepositoryGitInfo(str string) *GitInfo

Jump to

Keyboard shortcuts

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