Documentation ¶
Index ¶
- Constants
- Variables
- func CommitishToHash(committish string) string
- func CurrentBranch() (string, error)
- func NameToPath(object string) (string, error)
- func PrettyPrintTree(tree Object, recurse, dirsOnly bool, dir string) (string, error)
- func ReadCommit(committish string) (commit, error)
- type Branch
- type Entry
- type Object
Constants ¶
View Source
const ( OBJ_BAD = -1 OBJ_NONE = 0 OBJ_COMMIT = 1 OBJ_TREE = 2 OBJ_BLOB = 3 OBJ_TAG = 4 /* 5 for future expansion */ OBJ_OFS_DELTA = 6 OBJ_REF_DELTA = 7 OBJ_ANY OBJ_MAX )
Variables ¶
View Source
var LookupObject = func(hash string) (Object, error) { if len(hash) == 0 { return Object{}, fmt.Errorf("invalid hash %s\n", hash) } o, err := findHash(hashToBytes(hash)) if err != nil { return Object{}, err } if o != nil { return *o, nil } file, err := openObjectFile(hash) if err != nil { return Object{}, fmt.Errorf("open %v", err) } r, err := getZlibReader(file) if err != nil { _ = file.Close() return Object{}, fmt.Errorf("zlib reader %v", err) } o, err = parseObject(r, r) if err != nil { _ = file.Close() return Object{}, fmt.Errorf("parse %v", err) } o.file = file return *o, nil }
Functions ¶
func CommitishToHash ¶
func CurrentBranch ¶
func NameToPath ¶
func PrettyPrintTree ¶
func ReadCommit ¶
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.