Esempio n. 1
0
func (repo *Repository) LookupBlob(oid *Oid) (*Blob, error) {
	blob := new(Blob)
	ecode := C.git_blob_lookup(&blob.git_blob, repo.git_repository, oid.git_oid)
	if ecode != git_SUCCESS {
		return nil, gitError()
	}
	return blob, nil
}
Esempio n. 2
0
func (v *Repository) LookupBlob(o *Oid) (*Blob, error) {
	blob := new(Blob)
	ecode := C.git_blob_lookup(&blob.ptr, v.ptr, o.toC())
	if ecode < 0 {
		return nil, LastError()
	}

	runtime.SetFinalizer(blob, (*Blob).Free)
	return blob, nil
}