Documentation
¶
Index ¶
- Variables
- type Address
- type AddressType
- type Project
- type Repository
- func (r Repository) Checkout(remote git.Remote, branch string) git.Checkout
- func (r Repository) CommitChanges(message string) (*object.Commit, error)
- func (r Repository) DeleteBranch(branch string) error
- func (r Repository) Fetch(remote git.Remote) error
- func (r Repository) ListRemote(remote git.Remote) ([]*plumbing.Reference, error)
- func (r Repository) Merge(remote *git.Remote, branch string) error
- func (r Repository) Push(remote git.Remote, refname plumbing.ReferenceName) error
- func (r Repository) Remote(name string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotGitRepo when target isn't a git repository. ErrNotGitRepo = errors.New("not a git repository") // ErrRemoteOperationFailed when remote git repository operation failed. ErrRemoteOperationFailed = errors.New("remote git operation failed") // ErrLocalOperationFailed when local git repository operation failed. ErrLocalOperationFailed = errors.New("local git operation failed") )
View Source
var ( // ErrInvalidAddress when an invalid address is provided to ParseAddress func. ErrInvalidAddress = errors.New("invalid address") )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Type AddressType Protocol string User string Host string Path string Ext string }
Address represents a GIT remote address.
func ParseAddress ¶
ParseAddress of a GIT remote URL.
type AddressType ¶
type AddressType int
AddressType is a type of GIT remote address.
const ( // AddressTypeGit is a type of GIT address. AddressTypeGit AddressType = iota // AddressTypeHTTP is a type of HTTP address. AddressTypeHTTP )
type Project ¶
Project is a project with Git information attached.
func NewProject ¶
NewProject creates a new Project from regular config.Project.
func (Project) Repository ¶
func (p Project) Repository() *Repository
Repository returns a Git repository implementation.
type Repository ¶
Repository is an implementation of git repository using Golang library.
func (Repository) CommitChanges ¶
func (r Repository) CommitChanges(message string) (*object.Commit, error)
func (Repository) DeleteBranch ¶
func (r Repository) DeleteBranch(branch string) error
func (Repository) ListRemote ¶
func (Repository) Push ¶
func (r Repository) Push(remote git.Remote, refname plumbing.ReferenceName) error
Click to show internal directories.
Click to hide internal directories.