MCPcopy Create free account
hub / github.com/libgit2/git2go / Update

Method Update

submodule.go:367–385  ·  view source on GitHub ↗
(init bool, opts *SubmoduleUpdateOptions)

Source from the content-addressed store, hash-verified

365}
366
367func (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error {
368 var err error
369 cOpts := populateSubmoduleUpdateOptions(&C.git_submodule_update_options{}, opts, &err)
370 defer freeSubmoduleUpdateOptions(cOpts)
371
372 runtime.LockOSThread()
373 defer runtime.UnlockOSThread()
374
375 ret := C.git_submodule_update(sub.ptr, cbool(init), cOpts)
376 runtime.KeepAlive(sub)
377 if ret == C.int(ErrorCodeUser) && err != nil {
378 return err
379 }
380 if ret < 0 {
381 return MakeGitError(ret)
382 }
383
384 return nil
385}
386
387func populateSubmoduleUpdateOptions(copts *C.git_submodule_update_options, opts *SubmoduleUpdateOptions, errorTarget *error) *C.git_submodule_update_options {
388 C.git_submodule_update_options_init(copts, C.GIT_SUBMODULE_UPDATE_OPTIONS_VERSION)

Callers

nothing calls this directly

Calls 4

cboolFunction · 0.85
MakeGitErrorFunction · 0.85

Tested by

no test coverage detected