Documentation ¶
Index ¶
- Constants
- type Repository
- func (r *Repository) Branch() string
- func (r *Repository) CheckRef(ref string) error
- func (r *Repository) CheckoutBranch(branch *git.Branch, opts *git.CheckoutOpts) error
- func (r *Repository) Clone(path string) error
- func (r *Repository) DiffStatus(ref string) ([]git.DiffDelta, error)
- func (r *Repository) Name() string
- func (r *Repository) Pull(branchName string) (git.MergeAnalysis, error)
Constants ¶
View Source
const ( RepositoryError = iota // Unused, it will always get returned with an err RepositoryCloned RepositoryOpened )
Status codes for Repository object creation
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
Repository is used to hold the git repository object and it's configuration
func LoadRepos ¶
func LoadRepos(cfg *config.Config) ([]*Repository, error)
LoadRepos populates Repository slice from configuration. It also handles cloning of the repository if not present
func (*Repository) CheckRef ¶
func (r *Repository) CheckRef(ref string) error
CheckRef checks whether a particular ref is part of the repository
func (*Repository) CheckoutBranch ¶
func (r *Repository) CheckoutBranch(branch *git.Branch, opts *git.CheckoutOpts) error
CheckoutBranch performs a checkout on a specific branch
func (*Repository) Clone ¶
func (r *Repository) Clone(path string) error
Clone the repository. Cloning will only checkout tracked branches. A destination path to clone to needs to be provided
func (*Repository) DiffStatus ¶
func (r *Repository) DiffStatus(ref string) ([]git.DiffDelta, error)
DiffStatus compares the current workdir with a target ref and return the modified files
func (*Repository) Pull ¶
func (r *Repository) Pull(branchName string) (git.MergeAnalysis, error)
Pull a repository branch, which is equivalent to a fetch and merge
Source Files ¶
Click to show internal directories.
Click to hide internal directories.