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

Method Lookup

reference.go:30–45  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

28}
29
30func (c *ReferenceCollection) Lookup(name string) (*Reference, error) {
31 cname := C.CString(name)
32 defer C.free(unsafe.Pointer(cname))
33 var ptr *C.git_reference
34
35 runtime.LockOSThread()
36 defer runtime.UnlockOSThread()
37
38 ecode := C.git_reference_lookup(&ptr, c.repo.ptr, cname)
39 runtime.KeepAlive(c)
40 if ecode < 0 {
41 return nil, MakeGitError(ecode)
42 }
43
44 return newReferenceFromC(ptr, c.repo), nil
45}
46
47func (c *ReferenceCollection) Create(name string, id *Oid, force bool, msg string) (*Reference, error) {
48 cname := C.CString(name)

Callers

nothing calls this directly

Calls 3

MakeGitErrorFunction · 0.85
newReferenceFromCFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected