summaryrefslogtreecommitdiff
path: root/blob.go
diff options
context:
space:
mode:
authorJesse Ezell <[email protected]>2014-04-04 00:22:42 -0700
committerJesse Ezell <[email protected]>2014-04-04 00:22:42 -0700
commit864c57f554821143b6298e3b927d362d996a32c2 (patch)
treef4f863d218f454a319cf14d925e058cc6a069eae /blob.go
parent0b48ba2224ec41dfc10a379ce1b7bb86441cc432 (diff)
parent9cd1d129bcd567ef65137783a603f8d898d8d933 (diff)
merge latest, copy merge bytes to go array
Diffstat (limited to 'blob.go')
-rw-r--r--blob.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/blob.go b/blob.go
index 4cee876..4277127 100644
--- a/blob.go
+++ b/blob.go
@@ -20,15 +20,16 @@ import (
type Blob struct {
gitObject
+ cast_ptr *C.git_blob
}
func (v *Blob) Size() int64 {
- return int64(C.git_blob_rawsize(v.ptr))
+ return int64(C.git_blob_rawsize(v.cast_ptr))
}
func (v *Blob) Contents() []byte {
- size := C.int(C.git_blob_rawsize(v.ptr))
- buffer := unsafe.Pointer(C.git_blob_rawcontent(v.ptr))
+ size := C.int(C.git_blob_rawsize(v.cast_ptr))
+ buffer := unsafe.Pointer(C.git_blob_rawcontent(v.cast_ptr))
return C.GoBytes(buffer, size)
}