Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGitCommandEnvAndURL ¶
func GetGitCommandEnvAndURL(repo, username, password string, sshPrivateKey string) (string, []string, error)
GetGitCommandOptions returns URL and env options for git operation
func NormalizeGitURL ¶
NormalizeGitURL normalizes a git URL for lookup and storage
Types ¶
type Client ¶
type Client interface { CloneOrFetch(url string, username string, password string, sshPrivateKey string, repoPath string) error Checkout(repoPath string, sha string) (string, error) Reset(repoPath string) error }
Client is a generic git client interface
func NewNativeGitClient ¶
NewNativeGitClient creates new instance of NativeGitClient
type NativeGitClient ¶
type NativeGitClient struct {
// contains filtered or unexported fields
}
NativeGitClient implements Client interface using git CLI
func (*NativeGitClient) Checkout ¶
func (m *NativeGitClient) Checkout(repoPath string, sha string) (string, error)
Checkout checkout specified git sha
func (*NativeGitClient) CloneOrFetch ¶
func (m *NativeGitClient) CloneOrFetch(repo string, username string, password string, sshPrivateKey string, repoPath string) error
CloneOrFetch either clone or fetch repository into specified directory path.
func (*NativeGitClient) Reset ¶
func (m *NativeGitClient) Reset(repoPath string) error
Reset resets local changes
Click to show internal directories.
Click to hide internal directories.