summaryrefslogtreecommitdiff
path: root/checkout.go
diff options
context:
space:
mode:
Diffstat (limited to 'checkout.go')
-rw-r--r--checkout.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/checkout.go b/checkout.go
index 5a61b54..ba411ff 100644
--- a/checkout.go
+++ b/checkout.go
@@ -73,8 +73,12 @@ func checkoutOptionsFromC(c *C.git_checkout_options) CheckoutOpts {
opts.FileMode = os.FileMode(c.file_mode)
opts.FileOpenFlags = int(c.file_open_flags)
opts.NotifyFlags = CheckoutNotifyType(c.notify_flags)
- opts.NotifyCallback = pointerHandles.Get(c.notify_payload).(CheckoutOpts).NotifyCallback
- opts.ProgressCallback = pointerHandles.Get(c.progress_payload).(CheckoutOpts).ProgressCallback
+ if c.notify_payload != nil {
+ opts.NotifyCallback = pointerHandles.Get(c.notify_payload).(CheckoutOpts).NotifyCallback
+ }
+ if c.progress_payload != nil {
+ opts.ProgressCallback = pointerHandles.Get(c.progress_payload).(CheckoutOpts).ProgressCallback
+ }
if c.target_directory != nil {
opts.TargetDirectory = C.GoString(c.target_directory)
}