git

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Head = "HEAD"

Head :

Variables

View Source
var (
	// ErrIsNotInWorkingDirectory :
	ErrIsNotInWorkingDirectory = errors.New("not in working directory")
)

Functions

func IsWorking

func IsWorking() (bool, error)

IsWorking will check the current directory is inside work tree.

Types

type Git

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

Git handles git command and get informations from repository.

func OpenDir

func OpenDir(dir string) (git *Git, reterr error)

OpenDir current directory

func (*Git) AheadCount

func (g *Git) AheadCount() (int, error)

AheadCount :

func (*Git) AheadCountVar

func (g *Git) AheadCountVar(v *int) error

AheadCountVar :

func (*Git) BaseBranch

func (g *Git) BaseBranch(branch string) (string, error)

BaseBranch :

func (*Git) BaseBranchVar

func (g *Git) BaseBranchVar(branch string, v *string) error

BaseBranchVar :

func (*Git) BehindCount

func (g *Git) BehindCount() (int, error)

BehindCount :

func (*Git) BehindCountFrom

func (g *Git) BehindCountFrom(baseBranch string) (int, error)

BehindCountFrom :

func (*Git) BehindCountFromVar

func (g *Git) BehindCountFromVar(baseBranch string, v *int) error

BehindCountFromVar :

func (*Git) BehindCountVar

func (g *Git) BehindCountVar(v *int) error

BehindCountVar :

func (*Git) Branch

func (g *Git) Branch() (string, error)

Branch :

func (*Git) BranchVar

func (g *Git) BranchVar(v *string) error

BranchVar :

func (*Git) Call

func (g *Git) Call(args ...string) ([]byte, error)

Call git with arguments. If true given in lock, escape the index file.

func (*Git) Close

func (g *Git) Close() error

Close git repository

func (*Git) Email

func (g *Git) Email() (string, error)

Email :

func (*Git) EmailVar

func (g *Git) EmailVar(v *string) error

EmailVar :

func (*Git) LastCommitHash

func (g *Git) LastCommitHash() (string, error)

LastCommitHash :

func (*Git) LastCommitHashVar

func (g *Git) LastCommitHashVar(v *string) error

LastCommitHashVar :

func (*Git) LastCommitMessage

func (g *Git) LastCommitMessage() (string, error)

LastCommitMessage :

func (*Git) LastCommitMessageVar

func (g *Git) LastCommitMessageVar(v *string) error

LastCommitMessageVar :

func (*Git) LastCommitter

func (g *Git) LastCommitter() (string, error)

LastCommitter :

func (*Git) LastCommitterVar

func (g *Git) LastCommitterVar(v *string) error

LastCommitterVar :

func (*Git) Remote

func (g *Git) Remote(branch string) (string, error)

Remote :

func (*Git) RemoteURL

func (g *Git) RemoteURL(remote string) (string, error)

RemoteURL :

func (*Git) RemoteURLVar

func (g *Git) RemoteURLVar(remote string, v *string) error

RemoteURLVar :

func (*Git) RemoteVar

func (g *Git) RemoteVar(branch string, v *string) error

RemoteVar :

func (*Git) Root

func (g *Git) Root() string

Root directory

func (*Git) Staged

func (g *Git) Staged() (bool, error)

Staged :

func (*Git) StagedVar

func (g *Git) StagedVar(v *bool) error

StagedVar :

func (*Git) StashCount

func (g *Git) StashCount() (int, error)

StashCount :

func (*Git) StashCountVar

func (g *Git) StashCountVar(v *int) error

StashCountVar :

func (*Git) Unstaged

func (g *Git) Unstaged() (bool, error)

Unstaged :

func (*Git) UnstagedVar

func (g *Git) UnstagedVar(v *bool) error

UnstagedVar :

func (*Git) Untracked

func (g *Git) Untracked() (bool, error)

Untracked :

func (*Git) UntrackedVar

func (g *Git) UntrackedVar(v *bool) error

UntrackedVar :

func (*Git) Upstream

func (g *Git) Upstream() (string, error)

Upstream :

func (*Git) UpstreamVar

func (g *Git) UpstreamVar(v *string) error

UpstreamVar :

Jump to

Keyboard shortcuts

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