diff options
| author | Mark Probst <[email protected]> | 2015-03-04 11:39:35 -0800 |
|---|---|---|
| committer | Mark Probst <[email protected]> | 2015-03-04 15:52:57 -0800 |
| commit | e439b931a6b23a84fd0d32114b25a9dd5e08ac29 (patch) | |
| tree | 336a9523da188e9835afdd15a433e5d57979a2ed /submodule.go | |
| parent | db5fa66b483816614950b36bf204a0de681b705a (diff) | |
Default signature
Diffstat (limited to 'submodule.go')
| -rw-r--r-- | submodule.go | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/submodule.go b/submodule.go index 6923c61..7c6c922 100644 --- a/submodule.go +++ b/submodule.go @@ -318,7 +318,10 @@ func (repo *Repository) ReloadAllSubmodules(force bool) error { func (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error { var copts C.git_submodule_update_options - populateSubmoduleUpdateOptions(&copts, opts) + err := populateSubmoduleUpdateOptions(&copts, opts) + if err != nil { + return err + } runtime.LockOSThread() defer runtime.UnlockOSThread() @@ -331,15 +334,22 @@ func (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error { return nil } -func populateSubmoduleUpdateOptions(ptr *C.git_submodule_update_options, opts *SubmoduleUpdateOptions) { +func populateSubmoduleUpdateOptions(ptr *C.git_submodule_update_options, opts *SubmoduleUpdateOptions) error { C.git_submodule_update_init_options(ptr, C.GIT_SUBMODULE_UPDATE_OPTIONS_VERSION) if opts == nil { - return + return nil } populateCheckoutOpts(&ptr.checkout_opts, opts.CheckoutOpts) populateRemoteCallbacks(&ptr.remote_callbacks, opts.RemoteCallbacks) ptr.clone_checkout_strategy = C.uint(opts.CloneCheckoutStrategy) - ptr.signature = opts.Signature.toC() + + sig, err := opts.Signature.toC() + if err != nil { + return err + } + ptr.signature = sig + + return nil } |
