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

Method DefaultRef

note.go:123–139  ·  view source on GitHub ↗

DefaultRef returns the default notes reference for a repository

()

Source from the content-addressed store, hash-verified

121
122// DefaultRef returns the default notes reference for a repository
123func (c *NoteCollection) DefaultRef() (string, error) {
124 buf := C.git_buf{}
125
126 runtime.LockOSThread()
127 defer runtime.UnlockOSThread()
128
129 ecode := C.git_note_default_ref(&buf, c.repo.ptr)
130 runtime.KeepAlive(c)
131 if ecode < 0 {
132 return "", MakeGitError(ecode)
133 }
134
135 ret := C.GoString(buf.ptr)
136 C.git_buf_dispose(&buf)
137
138 return ret, nil
139}
140
141// Note
142type Note struct {

Callers 2

TestDefaultNoteRefFunction · 0.80
TestIsNoteFunction · 0.80

Calls 1

MakeGitErrorFunction · 0.85

Tested by 2

TestDefaultNoteRefFunction · 0.64
TestIsNoteFunction · 0.64