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 ¶
- type Repository
- func (r *Repository) Command(args ...string) *exec.Cmd
- func (r *Repository) Dir() string
- func (r *Repository) Run(args ...string) (string, error)
- func (r *Repository) RunCmd(cmd *exec.Cmd) (string, error)
- func (r *Repository) RunCmdSha(cmd *exec.Cmd) (string, error)
- func (r *Repository) RunSha(args ...string) (string, error)
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) 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
Click to show internal directories.
Click to hide internal directories.