Address issue #108 #109
|
@ -8,6 +8,7 @@ import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Status int
|
type Status int
|
||||||
|
@ -150,6 +151,9 @@ func (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runtime.LockOSThread()
|
||||||
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
ret := C.git_status_list_new(&ptr, v.ptr, copts)
|
ret := C.git_status_list_new(&ptr, v.ptr, copts)
|
||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
return nil, MakeGitError(ret)
|
return nil, MakeGitError(ret)
|
||||||
|
@ -161,6 +165,11 @@ func (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error) {
|
||||||
func (v *Repository) StatusFile(path string) (Status, error) {
|
func (v *Repository) StatusFile(path string) (Status, error) {
|
||||||
var statusFlags C.uint
|
var statusFlags C.uint
|
||||||
cPath := C.CString(path)
|
cPath := C.CString(path)
|
||||||
|
defer C.free(unsafe.Pointer(cPath))
|
||||||
|
|
||||||
|
runtime.LockOSThread()
|
||||||
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
ret := C.git_status_file(&statusFlags, v.ptr, cPath)
|
ret := C.git_status_file(&statusFlags, v.ptr, cPath)
|
||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
return 0, MakeGitError(ret)
|
return 0, MakeGitError(ret)
|
||||||
|
|
Loading…
Reference in New Issue