odb: Expose git_odb_object_type() as OdbObject.Type() #328

Merged
navytux merged 1 commits from y/odb-type into next 2016-07-24 11:09:12 -05:00
1 changed files with 4 additions and 0 deletions

4
odb.go
View File

@ -226,6 +226,10 @@ func (object *OdbObject) Len() (len uint64) {
return uint64(C.git_odb_object_size(object.ptr)) return uint64(C.git_odb_object_size(object.ptr))
} }
func (object *OdbObject) Type() ObjectType {
return ObjectType(C.git_odb_object_type(object.ptr))
}
func (object *OdbObject) Data() (data []byte) { func (object *OdbObject) Data() (data []byte) {
var c_blob unsafe.Pointer = C.git_odb_object_data(object.ptr) var c_blob unsafe.Pointer = C.git_odb_object_data(object.ptr)
var blob []byte var blob []byte