Documentation
¶
Index ¶
Constants ¶
View Source
const (
GitAskPassEnv = "GIT_ASKPASS"
)
Variables ¶
This section is empty.
Functions ¶
func HashesEqual ¶
Types ¶
type CloneOptions ¶
type CloneOptions struct {
// Path to a local repo which should be used as a reference for a new clone.
// Equivalent of the --reference CLI flag.
ReferenceDir string
// How many commits to fetch. Equivalent of the --depth CLI flag.
Depth int
// Head to fetch: it can be a branch name, a tag name, or a hash.
Ref string
}
type Credentials ¶
type FetchOptions ¶
type OurGit ¶
type OurGit interface {
GetCurrentHash(localDir string) (string, error)
DoesBranchExist(localDir string, branchName string) (bool, error)
DoesTagExist(localDir string, tagName string) (bool, error)
GetToplevelDir(localDir string) (string, error)
Checkout(localDir string, id string, refType RefType) error
ResetHard(localDir string) error
Pull(localDir string, branch string) error
Fetch(localDir string, what string, opts FetchOptions) error
IsClean(localDir, version string, excludeGlobs []string) (bool, error)
Clone(srcURL, localDir string, opts CloneOptions) error
GetOriginURL(localDir string) (string, error)
}
func NewOurGitGoGit ¶
func NewOurGitGoGit(creds *Credentials) OurGit
NewOurGit returns a go-git-based implementation of OurGit (it doesn't require an external git binary, but is somewhat limited; for example, it doesn't support referenced repositories)
func NewOurGitShell ¶
func NewOurGitShell(creds *Credentials) OurGit
NewOurGit returns a shell-based implementation of OurGit (external git binary is required for that to work)
Click to show internal directories.
Click to hide internal directories.