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

Method Lookup

submodule.go:95–110  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

93}
94
95func (c *SubmoduleCollection) Lookup(name string) (*Submodule, error) {
96 cname := C.CString(name)
97 defer C.free(unsafe.Pointer(cname))
98
99 var ptr *C.git_submodule
100
101 runtime.LockOSThread()
102 defer runtime.UnlockOSThread()
103
104 ret := C.git_submodule_lookup(&ptr, c.repo.ptr, cname)
105 if ret < 0 {
106 return nil, MakeGitError(ret)
107 }
108
109 return newSubmoduleFromC(ptr, c.repo), nil
110}
111
112// SubmoduleCallback is a function that is called for every submodule found in SubmoduleCollection.Foreach.
113type SubmoduleCallback func(sub *Submodule, name string) error

Callers

nothing calls this directly

Calls 3

MakeGitErrorFunction · 0.85
newSubmoduleFromCFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected