summaryrefslogtreecommitdiff
path: root/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/repository.go b/repository.go
index b65867b..9917c60 100644
--- a/repository.go
+++ b/repository.go
@@ -616,16 +616,19 @@ func (v *Repository) RemoveNote(ref string, author, committer *Signature, id *Oi
// DefaultNoteRef returns the default notes reference for a repository
func (v *Repository) DefaultNoteRef() (string, error) {
- var ptr *C.char
+ buf := C.git_buf{}
runtime.LockOSThread()
defer runtime.UnlockOSThread()
- if ret := C.git_note_default_ref(&ptr, v.ptr); ret < 0 {
+ if ret := C.git_note_default_ref(&buf, v.ptr); ret < 0 {
return "", MakeGitError(ret)
}
- return C.GoString(ptr), nil
+ ret := C.GoString(buf.ptr)
+ C.git_buf_free(&buf)
+
+ return ret, nil
}
type RepositoryState int