repository

package
v0.0.0-...-af9a2c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

type Repository struct {
	sync.Mutex

	*git.Repository
	Config *config.Repo
}

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 New

func New(repoBasePath string, repoConfig *config.Repo) (*Repository, int, error)

New is used to construct a new repository object from the configuration

func (*Repository) Branch

func (r *Repository) Branch() string

Branch returns the branch name

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) Name

func (r *Repository) Name() string

Name returns the repository name

func (*Repository) Pull

func (r *Repository) Pull(branchName string) (git.MergeAnalysis, error)

Pull a repository branch, which is equivalent to a fetch and merge

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL