diff options
| author | Aidan Nulman <[email protected]> | 2014-01-28 22:49:55 -0500 |
|---|---|---|
| committer | Aidan Nulman <[email protected]> | 2014-01-28 22:49:55 -0500 |
| commit | f610cf25d71d44881b31157832b49e793efc2d56 (patch) | |
| tree | fd96328d36655b7072651a042c888369e7e12c48 /checkout.go | |
| parent | e6865861496daef507dc08fa14a22a74269df211 (diff) | |
| parent | 66e1c476199ebcd3e304659992233132c5a52c6c (diff) | |
Merge branch 'master' into custom_odb
Diffstat (limited to 'checkout.go')
| -rw-r--r-- | checkout.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/checkout.go b/checkout.go index 63637e2..f4c1d4e 100644 --- a/checkout.go +++ b/checkout.go @@ -9,6 +9,7 @@ git_checkout_opts git_checkout_opts_init() { */ import "C" import ( + "runtime" "os" ) @@ -59,6 +60,9 @@ func (v *Repository) Checkout(opts *CheckoutOpts) error { var copts C.git_checkout_opts populateCheckoutOpts(&copts, opts) + runtime.LockOSThread() + defer runtime.UnlockOSThread() + ret := C.git_checkout_head(v.ptr, &copts) if ret < 0 { return LastError() @@ -72,6 +76,9 @@ func (v *Repository) CheckoutIndex(index *Index, opts *CheckoutOpts) error { var copts C.git_checkout_opts populateCheckoutOpts(&copts, opts) + runtime.LockOSThread() + defer runtime.UnlockOSThread() + ret := C.git_checkout_index(v.ptr, index.ptr, &copts) if ret < 0 { return LastError() |
