Example #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
}
Example #2
0
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
}