Add support for git_blob_is_binary #625

Merged
vvatanabe merged 2 commits from blob-git_blob_is_binary into master 2020-07-30 07:07:06 -05:00
1 changed files with 6 additions and 0 deletions
Showing only changes of commit 3d29c861a6 - Show all commits

View File

@ -40,6 +40,12 @@ func (v *Blob) Contents() []byte {
return goBytes
}
func (v *Blob) IsBinary() bool {
ret := C.git_blob_is_binary(v.cast_ptr) == 1
runtime.KeepAlive(v)
return ret
}
func (repo *Repository) CreateBlobFromBuffer(data []byte) (*Oid, error) {
runtime.LockOSThread()
defer runtime.UnlockOSThread()