summaryrefslogtreecommitdiff
path: root/index.go
diff options
context:
space:
mode:
authorAidan Nulman <[email protected]>2014-01-28 22:49:55 -0500
committerAidan Nulman <[email protected]>2014-01-28 22:49:55 -0500
commitf610cf25d71d44881b31157832b49e793efc2d56 (patch)
treefd96328d36655b7072651a042c888369e7e12c48 /index.go
parente6865861496daef507dc08fa14a22a74269df211 (diff)
parent66e1c476199ebcd3e304659992233132c5a52c6c (diff)
Merge branch 'master' into custom_odb
Diffstat (limited to 'index.go')
-rw-r--r--index.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/index.go b/index.go
index 4a69c1e..ac5148c 100644
--- a/index.go
+++ b/index.go
@@ -24,6 +24,9 @@ func (v *Index) AddByPath(path string) error {
cstr := C.CString(path)
defer C.free(unsafe.Pointer(cstr))
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
ret := C.git_index_add_bypath(v.ptr, cstr)
if ret < 0 {
return LastError()
@@ -34,6 +37,10 @@ func (v *Index) AddByPath(path string) error {
func (v *Index) WriteTree() (*Oid, error) {
oid := new(Oid)
+
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
ret := C.git_index_write_tree(oid.toC(), v.ptr)
if ret < 0 {
return nil, LastError()