예제 #1
0
func (repo *Repository) NewPackbuilder() (*Packbuilder, error) {
	builder := &Packbuilder{}
	ret := C.git_packbuilder_new(&builder.ptr, repo.ptr)
	if ret != 0 {
		return nil, LastError()
	}
	runtime.SetFinalizer(builder, (*Packbuilder).Free)
	return builder, nil
}
예제 #2
0
파일: packbuilder.go 프로젝트: wid/git2go
func (repo *Repository) NewPackbuilder() (*Packbuilder, error) {
	builder := &Packbuilder{}

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_packbuilder_new(&builder.ptr, repo.ptr)
	if ret != 0 {
		return nil, MakeGitError(ret)
	}
	runtime.SetFinalizer(builder, (*Packbuilder).Free)
	return builder, nil
}