storagegit

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package storagegit implements git utilities.

This uses https://github.com/src-d/go-git.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(
	ctx context.Context,
	logger *zap.Logger,
	getenv func(string) string,
	homeDirPath string,
	gitURL string,
	refName RefName,
	httpsUsernameEnvKey string,
	httpsPasswordEnvKey string,
	sshKeyFileEnvKey string,
	sshKeyPassphraseEnvKey string,
	sshKnownHostsFilesEnvKey string,
	bucket storage.Bucket,
	options ...storagepath.TransformerOption,
) error

Clone clones the url into the bucket.

This is roughly equivalent to git clone --branch gitBranch --single-branch --depth 1 gitUrl. Only regular files are added to the bucket.

Branch is required.

If the gitURL begins with https:// and there is an HTTPS username and password, basic auth will be used. If the gitURL begins with ssh:// and there is a valid SSH configuration, ssh will be used.

This really needs more testing and cleanup. Only use for local CLI checking.

Types

type RefName added in v0.7.0

type RefName interface {
	// contains filtered or unexported methods
}

RefName is a git reference name.

func NewBranchRefName added in v0.7.0

func NewBranchRefName(branch string) RefName

NewBranchRefName returns a new branch RefName.

func NewTagRefName added in v0.7.0

func NewTagRefName(tag string) RefName

NewTagRefName returns a new tag RefName.

Jump to

Keyboard shortcuts

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