Documentation ¶
Index ¶
- func IsCommitSHA(sha string) bool
- func IsSSHURL(url string) bool
- func IsTruncatedCommitSHA(sha string) bool
- func NormalizeGitURL(repo string) string
- func SameURL(leftRepo, rightRepo string) bool
- func TestRepo(repo, username, password string, sshPrivateKey string) error
- type Client
- type ClientFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCommitSHA ¶ added in v0.6.0
IsCommitSHA returns whether or not a string is a 40 character SHA-1
func IsTruncatedCommitSHA ¶ added in v0.9.0
IsTruncatedCommitSHA returns whether or not a string is a truncated SHA-1
func NormalizeGitURL ¶
NormalizeGitURL normalizes a git URL for purposes of comparison, as well as preventing redundant local clones (by normalizing various forms of a URL to a consistent location). Prefer using SameURL() over this function when possible. This algorithm may change over time and should not be considered stable from release to release
Types ¶
type Client ¶
type Client interface { Root() string Init() error Fetch() error Checkout(revision string) error LsRemote(revision string) (string, error) LsFiles(path string) ([]string, error) CommitSHA() (string, error) }
Client is a generic git client interface
type ClientFactory ¶ added in v0.4.0
type ClientFactory interface {
NewClient(repoURL, path, username, password, sshPrivateKey string) (Client, error)
}
ClientFactory is a factory of Git Clients Primarily used to support creation of mock git clients during unit testing
func NewFactory ¶ added in v0.4.0
func NewFactory() ClientFactory
Click to show internal directories.
Click to hide internal directories.