Update vendored libgit2 to v0.27.0-rc1 #434

Merged
carlosmn merged 4 commits from cmn/bumping into master 2018-02-22 03:06:47 -06:00
1 changed files with 8 additions and 2 deletions
Showing only changes of commit cff71166ec - Show all commits

10
odb.go
View File

@ -182,17 +182,21 @@ func (v *Odb) Hash(data []byte, otype ObjectType) (oid *Oid, err error) {
// contents of the object.
func (v *Odb) NewReadStream(id *Oid) (*OdbReadStream, error) {
stream := new(OdbReadStream)
var ctype C.git_otype
var csize C.size_t
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ret := C.git_odb_open_rstream(&stream.ptr, v.ptr, id.toC())
ret := C.git_odb_open_rstream(&stream.ptr, &csize, &ctype, v.ptr, id.toC())
runtime.KeepAlive(v)
runtime.KeepAlive(id)
if ret < 0 {
return nil, MakeGitError(ret)
}
stream.Size = uint64(csize)
stream.Type = ObjectType(ctype)
runtime.SetFinalizer(stream, (*OdbReadStream).Free)
return stream, nil
}
@ -264,7 +268,9 @@ func (object *OdbObject) Data() (data []byte) {
}
type OdbReadStream struct {
ptr *C.git_odb_stream
ptr *C.git_odb_stream
Size uint64
Type ObjectType
}
// Read reads from the stream