Example #1
0
func (repo *Repository) DefaultNoteRef() (string, error) {
	var ref [1]int8
	cref := (*C.char)(&ref[0])
	ecode := C.git_note_default_ref(&cref, repo.git_repository)
	if ecode != git_SUCCESS {
		return "", gitError()
	}
	return C.GoString(cref), nil
}
Example #2
0
// DefaultNoteRef returns the default notes reference for a repository
func (v *Repository) DefaultNoteRef() (string, error) {
	var ptr *C.char

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	if ret := C.git_note_default_ref(&ptr, v.ptr); ret < 0 {
		return "", MakeGitError(ret)
	}

	return C.GoString(ptr), nil
}
Example #3
0
File: note.go Project: wid/git2go
// DefaultRef returns the default notes reference for a repository
func (c *NoteCollection) DefaultRef() (string, error) {
	buf := C.git_buf{}

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	if ret := C.git_note_default_ref(&buf, c.repo.ptr); ret < 0 {
		return "", MakeGitError(ret)
	}

	ret := C.GoString(buf.ptr)
	C.git_buf_free(&buf)

	return ret, nil
}