From cf7553e72cea560d3398b7f0a5e50f812e91443a Mon Sep 17 00:00:00 2001 From: Kirill Smelkov Date: Tue, 19 Jul 2016 22:48:52 +0300 Subject: [PATCH] odb: Expose git_odb_object_type() as OdbObject.Type() It might be needed when one is writing `git cat-file --batch` equivalent which has output format SP SP LF LF --- odb.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/odb.go b/odb.go index 9c6baa3..28bfad6 100644 --- a/odb.go +++ b/odb.go @@ -226,6 +226,10 @@ func (object *OdbObject) Len() (len uint64) { 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) { var c_blob unsafe.Pointer = C.git_odb_object_data(object.ptr) var blob []byte