Documentation
¶
Index ¶
- Constants
- Variables
- func Branch(prj string) (branch string, err error)
- func BranchExists(prj, branch string) (exists bool, err error)
- func Checkout(prj, branch string, create bool) (err error)
- func Clone(wd, rel, remote, branch string) (result string, err error)
- func ConfigAdd(prj, key, val string) error
- func ConfigGet(prj, key string) (string, error)
- func Pull(prj string, ffonly, rebase bool) (result string, err error)
- func RemoteOrigin(prj string) (origin string, err error)
- func RemoteSetOrigin(prj, remote string) (err error)
- func RevListCountHead(prj string) (left, right int, err error)
- func RevParseHead(prj string) (result string, err error)
- func StatusWCL(prj string) (changes int, err error)
- func Upstream(prj string) (result string, err error)
- type ObjectType
- type Ref
Constants ¶
View Source
const ( BlobType = ObjectType(iota) TreeType CommitType TagType )
View Source
const (
DefaultTrimCut = "\n \t"
)
Variables ¶
View Source
var ( ObjectTypeByName = map[string]ObjectType{ "blob": BlobType, "tree": TreeType, "commit": CommitType, "tag": TagType, } )
Functions ¶
func BranchExists ¶
BranchExists returns true if the branch exists
func RemoteOrigin ¶
RemoteOrigin returns the current remote.origin.url if there is no "origin" remote, then an error is returned.
func RemoteSetOrigin ¶
RemoteSetOrigin set the current origin remote
func RevListCountHead ¶
RevParseHead read the current commit sha1
func RevParseHead ¶
RevParseHead read the current commit sha1
Types ¶
type ObjectType ¶
type ObjectType int
type Ref ¶
type Ref struct { Type ObjectType Name string }
func ForEachRef ¶
ForEachRef reads all refs from local git.
Click to show internal directories.
Click to hide internal directories.