Read reads the note for an object
(ref string, id *Oid)
| 63 | |
| 64 | // Read reads the note for an object |
| 65 | func (c *NoteCollection) Read(ref string, id *Oid) (*Note, error) { |
| 66 | var cref *C.char |
| 67 | if ref == "" { |
| 68 | cref = nil |
| 69 | } else { |
| 70 | cref = C.CString(ref) |
| 71 | defer C.free(unsafe.Pointer(cref)) |
| 72 | } |
| 73 | |
| 74 | runtime.LockOSThread() |
| 75 | defer runtime.UnlockOSThread() |
| 76 | |
| 77 | var ptr *C.git_note |
| 78 | ret := C.git_note_read(&ptr, c.repo.ptr, cref, id.toC()) |
| 79 | runtime.KeepAlive(c) |
| 80 | runtime.KeepAlive(id) |
| 81 | if ret < 0 { |
| 82 | return nil, MakeGitError(ret) |
| 83 | } |
| 84 | |
| 85 | return newNoteFromC(ptr, c.repo), nil |
| 86 | } |
| 87 | |
| 88 | // Remove removes the note for an object |
| 89 | func (c *NoteCollection) Remove(ref string, author, committer *Signature, id *Oid) error { |
nothing calls this directly
no test coverage detected