Documentation ¶
Overview ¶
Package versioncontrol is a simplified/stripped down version of go/internal/get/vcs that is aimed at the simplier temporary git clone needed for OpenFaaS template fetch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GitCheckRefName = &vcsCmd{ name: "Git", cmd: "git", cmds: []string{"check-ref-format --allow-onelevel {refname}"}, scheme: []string{"git", "https", "http", "git+ssh", "ssh"}, }
GitCheckRefName defines the command that validates if a string is a valid reference name or sha
var GitCheckout = &vcsCmd{ name: "Git", cmd: "git", cmds: []string{"-C {dir} checkout {refname}"}, scheme: []string{"git", "https", "http", "git+ssh", "ssh"}, }
GitCheckout defines the command to clone a specific REF of repo into a directory
var GitClone = &vcsCmd{ name: "Git", cmd: "git", cmds: []string{"clone {repo} {dir} --depth=1 --config core.autocrlf=false -b {refname}"}, scheme: []string{"git", "https", "http", "git+ssh", "ssh"}, }
GitClone defines the command to clone a repo into a directory
var GitCloneDefault = &vcsCmd{ name: "Git", cmd: "git", cmds: []string{"clone {repo} {dir} --depth=1 --config core.autocrlf=false"}, scheme: []string{"git", "https", "http", "git+ssh", "ssh"}, }
GitClone defines the command to clone the default branch of a repo into a directory
var GitInitRepo = &vcsCmd{ name: "Git", cmd: "git", cmds: []string{ "init {dir}", "config core.autocrlf false", "config user.email \"contact@openfaas.com\"", "config user.name \"OpenFaaS\"", "add {dir}", "commit -m \"Test-commit\"", }, scheme: []string{"git", "https", "http", "git+ssh", "ssh"}, }
GitInitRepo initializes the working directory add commit all files & directories
Functions ¶
func GetGitBranch ¶
func GetGitBranch() string
func GetGitDescribe ¶
func GetGitDescribe() string
GetGitDescribe returns the human readable name for the current commit using `git-describe`
func IsGitRemote ¶
IsGitRemote validates if the supplied string is a valid git remote url value
func IsPinnedGitRemote ¶
IsPinnedGitRemote validates if the supplied string is a valid git remote url value
func ParsePinnedRemote ¶
ParsePinnedRemote returns the remote url and contraint value from repository url
Types ¶
This section is empty.