diff options
author | Vadim Markovtsev <gmarkhor@gmail.com> | 2016-07-09 01:16:13 +0300 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-07-09 00:16:13 +0200 |
commit | dc1e2bd485f8345c14cf7b22a5b71fd03028cfdf (patch) | |
tree | e8069982be7c0d7e9334b032579c5767f9f09e8f /cshared/objects_cshared.go | |
parent | 5e73f01cb2e027a8f02801635b79d3a9bc866914 (diff) | |
download | go-git-dc1e2bd485f8345c14cf7b22a5b71fd03028cfdf.tar.gz |
Fix some bugs found during gypogit testing (#58)
Diffstat (limited to 'cshared/objects_cshared.go')
-rw-r--r-- | cshared/objects_cshared.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cshared/objects_cshared.go b/cshared/objects_cshared.go index 9f14598..68e7b4f 100644 --- a/cshared/objects_cshared.go +++ b/cshared/objects_cshared.go @@ -95,5 +95,15 @@ func c_Blob_Read(b uint64) (int, *C.char) { if err != nil { return ErrorCodeInternal, C.CString(err.Error()) } - return len(data), C.CString(string(data)) + return len(data), CBytes(data) +} + +//export c_Blob_Type +func c_Blob_Type(c uint64) int8 { + obj, ok := GetObject(Handle(c)) + if !ok { + return -1 + } + blob := obj.(*git.Blob) + return int8(blob.Type()) }
\ No newline at end of file |