EnsureLog ensures that there is a reflog for the given reference name and creates an empty one if necessary.
(name string)
| 103 | // EnsureLog ensures that there is a reflog for the given reference |
| 104 | // name and creates an empty one if necessary. |
| 105 | func (c *ReferenceCollection) EnsureLog(name string) error { |
| 106 | cname := C.CString(name) |
| 107 | defer C.free(unsafe.Pointer(cname)) |
| 108 | |
| 109 | runtime.LockOSThread() |
| 110 | defer runtime.UnlockOSThread() |
| 111 | |
| 112 | ret := C.git_reference_ensure_log(c.repo.ptr, cname) |
| 113 | runtime.KeepAlive(c) |
| 114 | if ret < 0 { |
| 115 | return MakeGitError(ret) |
| 116 | } |
| 117 | |
| 118 | return nil |
| 119 | } |
| 120 | |
| 121 | // HasLog returns whether there is a reflog for the given reference |
| 122 | // name |
nothing calls this directly
no test coverage detected