Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRepoAlreadyCloned = errors.New("Repository already cloned")
Functions ¶
Types ¶
type GitUtils ¶
type GitUtils struct {
// contains filtered or unexported fields
}
func (*GitUtils) CloneToDisk ¶
func (gu *GitUtils) CloneToDisk(ctx context.Context, httpsURL, sshURL, path string, progress io.Writer) (string, error)
CloneToDisk clones a repository to a path on disk. The repository is cloned first to a temporary path, and then renamed to the desired path. The function guarantees that if `path` exists, it contains a fully cloned repository. If an authentication method has been configured, the repository is cloned using sshURL, otherwise it is cloned using httpsURL. The progress of the clone operation is streamed to the progress io.Writer.
type Repository ¶
type Repository struct {
GitURL string
Path string
HeadRefName string
HeadRef string
LastCommitInfo commitInfo
}
func ReadRepository ¶
func ReadRepository(path string) (*Repository, error)
func (*Repository) LastCommit ¶
func (r *Repository) LastCommit() string
func (*Repository) String ¶
func (r *Repository) String() string
Click to show internal directories.
Click to hide internal directories.