Documentation ¶
Overview ¶
Package git allows working with Git repositories
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBareRoot ¶ added in v0.5.1
IsRoot returns true if location is the root of a bare git repository
func NameFromRepositoryURL ¶ added in v0.5.1
NameFromRepositoryURL suggests a name for a repository URL based on the last segment of the path, or returns false
Types ¶
type ChangedRef ¶ added in v0.5.1
func ParsePostReceive ¶ added in v0.5.1
func ParsePostReceive(r io.Reader) ([]ChangedRef, error)
type GitError ¶ added in v0.5.1
GitError is returned when the underlying Git command returns a non-zero exit code.
type Repository ¶
type Repository interface { GetRootDir(dir string) (string, error) GetOriginURL(dir string) (string, bool, error) GetRef(dir string) string Clone(dir string, url string) error CloneBare(dir string, url string) error CloneMirror(dir string, url string) error Fetch(dir string) error Checkout(dir string, ref string) error Archive(dir, ref, format string, w io.Writer) error Init(dir string, bare bool) error AddRemote(dir string, name, url string) error AddLocalConfig(dir, name, value string) error ShowFormat(dir, commit, format string) (string, error) }
Repository represents a git source repository
func NewRepository ¶
func NewRepository() Repository
NewRepository creates a new Repository for the given directory
func NewRepositoryForBinary ¶ added in v0.5.1
func NewRepositoryForBinary(gitBinaryPath string) Repository
NewRepositoryForBinary returns a Repository using the specified git executable.
Click to show internal directories.
Click to hide internal directories.