Add support for git_blob_is_binary

This commit is contained in:
Yuichi Watanabe 2020-07-30 05:34:42 +09:00
parent d8f9990d4d
commit 3d29c861a6
1 changed files with 6 additions and 0 deletions

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()