Documentation ¶
Overview ¶
Package storagegit implements git utilities.
This uses https://github.com/go-git/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 storagegitplumbing.RefName, recurseSubmodules bool, httpsUsernameEnvKey string, httpsPasswordEnvKey string, sshKeyFileEnvKey string, sshKeyPassphraseEnvKey string, sshKnownHostsFilesEnvKey string, readWriteBucket storage.ReadWriteBucket, 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.
func ExperimentalClone ¶ added in v0.11.0
func ExperimentalClone( ctx context.Context, logger *zap.Logger, environ []string, path string, branch string, tag string, recurseSubmodules bool, readWriteBucket storage.ReadWriteBucket, options ...storagepath.TransformerOption, ) (retErr error)
ExperimentalClone clones the url into the bucket.
This calls git clone --branch branch/tag --single-branch --depth 1 [--recurse-submodules] Only regular files are added to the bucket.
Branch is required.
Only use for local CLI checking.
Types ¶
This section is empty.