HasLog returns whether there is a reflog for the given reference name
(name string)
| 121 | // HasLog returns whether there is a reflog for the given reference |
| 122 | // name |
| 123 | func (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 |
| 140 | func (c *ReferenceCollection) Dwim(name string) (*Reference, error) { |