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

Method HasLog

reference.go:123–137  ·  view source on GitHub ↗

HasLog returns whether there is a reflog for the given reference name

(name string)

Source from the content-addressed store, hash-verified

121// HasLog returns whether there is a reflog for the given reference
122// name
123func (c *ReferenceCollection) HasLog(name string) (bool, error) {
124 cname := C.CString(name)
125 defer C.free(unsafe.Pointer(cname))
126
127 runtime.LockOSThread()
128 defer runtime.UnlockOSThread()
129
130 ret := C.git_reference_has_log(c.repo.ptr, cname)
131 runtime.KeepAlive(c)
132 if ret < 0 {
133 return false, MakeGitError(ret)
134 }
135
136 return ret == 1, nil
137}
138
139// Dwim looks up a reference by DWIMing its short name
140func (c *ReferenceCollection) Dwim(name string) (*Reference, error) {

Callers 1

TestUtilFunction · 0.80

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by 1

TestUtilFunction · 0.64