lib

package
v0.0.0-...-96d7121 Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommand

func RunCommand(cmd string, args ...string) ([]byte, error)

RunCommand executes a command with some given arguments. If the command fails to run, the content of stderr will be part of the returned error.

Types

type Git

type Git struct {
	RootDir string // Root directory of the Git repository
}

Git represents a Git local repository.

func NewGit

func NewGit() (*Git, error)

NewGit creates a new Git for the repository related to the current working directory. If the working directory is not in a Git repository then an error is returned.

func NewGitInDir

func NewGitInDir(dir string) (*Git, error)

NewGitInDir creates a new Git for the repository containing the given directory. If the given directory is not inside of a Git repository then an error is returned.

func (*Git) CommitFiles

func (g *Git) CommitFiles(sha string) ([]string, error)

CommitFiles returns the list of files changed in the commit of the given SHA. The file names are relative to the root of the Go repository.

func (*Git) Commits

func (g *Git) Commits(fromSHA, toSHA string) ([]GitCommit, error)

Commits returns a list of commits after fromSHA through toSHA. E.g. (fromSha, toSHA]. Commits are ordered from newest to older.

func (*Git) DiffFiles

func (g *Git) DiffFiles(fromSHA, toSHA string) ([]string, error)

DiffFiles returns list of files that were changed after fromSHA through toSHA. E.g. (fromSha, toSHA]. The file names are relative to the root of the Go repository.

type GitCommit

type GitCommit struct {
	SHA         string // Full SHA of the commit
	Description string // Commit description
}

GitCommit describes a Git commit.

type StringSet

type StringSet map[string]bool

StringSet represents an unordered set of strings.

func (StringSet) Add

func (s StringSet) Add(values ...string)

Add puts the given values into the set.

func (StringSet) Contains

func (s StringSet) Contains(value string) bool

Contains returns true iff the set contains the given value. s.contains("foo") and s["foo"] are equivalent.

func (StringSet) Slice

func (s StringSet) Slice() []string

Slice returns an arbitrarily ordered slice that contains each value in the set.

Jump to

Keyboard shortcuts

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