repo

package
v0.0.0-...-d20e5ad Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package repo provides utilities for operating on a git repo. Scoot often ends up with multiple git repos. E.g., one reference repo and then each checkout is in its own repo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository represents a valid Git repository.

func InitRepo

func InitRepo(dir string) (*Repository, error)

Try to initialize a new git repo in the given directory.

func NewRepository

func NewRepository(dir string) (*Repository, error)

NewRepo creates a new Repository for path `dir`. It checks that `dir` is a valid path.

func (*Repository) Command

func (r *Repository) Command(args ...string) *exec.Cmd

Command creates an exec.Cmd to use to run in this Git Repo

func (*Repository) Dir

func (r *Repository) Dir() string

Where r lives on disk

func (*Repository) Run

func (r *Repository) Run(args ...string) (string, error)

Run a git command in r

func (*Repository) RunCmd

func (r *Repository) RunCmd(cmd *exec.Cmd) (string, error)

RunCmd runs cmd (that must have been created by Command), returning its output and error

func (*Repository) RunCmdSha

func (r *Repository) RunCmdSha(cmd *exec.Cmd) (string, error)

RunCmdSha runs cmd (that must have been created by Command) expecting a sha

func (*Repository) RunSha

func (r *Repository) RunSha(args ...string) (string, error)

Run a git command that returns a sha.

Jump to

Keyboard shortcuts

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