repo

package
v26.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CherryCommit

type CherryCommit struct {
	// Hash is the SHA1 of the commit.
	Hash string

	// Found indicates if the commit was found in the upstream branch.
	Found bool
}

CherryCommit contains an entry returned by the "git cherry" command.

type WorkingTree

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

WorkingTree encapsulates a git repository.

func Get

func Get(dir string) (wt WorkingTree, err error)

Get returns a WorkingTree for the specified directory. If the directory is not the root of a git repository the directory hierarchy is walked to find the root (i.e. the directory where the .git dir resides).

func (WorkingTree) Branch

func (tw WorkingTree) Branch() (string, error)

Branch calls "git branch" to determine the current branch.

func (WorkingTree) Checkout

func (wt WorkingTree) Checkout(tree string) error

Checkout calls "git checkout" with the specified tree.

func (WorkingTree) Cherry

func (wt WorkingTree) Cherry(upstream string) ([]CherryCommit, error)

Cherry calls "git cherry" with the specified value for upstream. Returns a slice of commits yet to be applied to the specified upstream branch.

func (WorkingTree) CherryPick

func (wt WorkingTree) CherryPick(commit string) error

CherryPick calls "git cherry-pick" with the specified commit.

func (WorkingTree) Clone

func (wt WorkingTree) Clone(dest string) (result WorkingTree, err error)

Clone calls "git clone", cloning the working tree into the specified directory. The returned WorkingTree points to the clone of the repository.

func (WorkingTree) Root

func (wt WorkingTree) Root() string

Root returns the root directory of the working tree.

Jump to

Keyboard shortcuts

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