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

Function submoduleCallback

submodule.go:120–135  ·  view source on GitHub ↗

export submoduleCallback

(csub unsafe.Pointer, name *C.char, handle unsafe.Pointer)

Source from the content-addressed store, hash-verified

118
119//export submoduleCallback
120func submoduleCallback(csub unsafe.Pointer, name *C.char, handle unsafe.Pointer) C.int {
121 sub := &Submodule{ptr: (*C.git_submodule)(csub)}
122
123 data, ok := pointerHandles.Get(handle).(submoduleCallbackData)
124 if !ok {
125 panic("invalid submodule visitor callback")
126 }
127
128 err := data.callback(sub, C.GoString(name))
129 if err != nil {
130 *data.errorTarget = err
131 return C.int(ErrorCodeUser)
132 }
133
134 return C.int(ErrorCodeOK)
135}
136
137func (c *SubmoduleCollection) Foreach(callback SubmoduleCallback) error {
138 var err error

Callers

nothing calls this directly

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…