func (pb *Packbuilder) WriteToFile(name string) error { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) ret := C.git_packbuilder_write(pb.ptr, cname, nil, nil) if ret != 0 { return LastError() } return nil }
func (pb *Packbuilder) WriteToFile(name string, mode os.FileMode) error { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_packbuilder_write(pb.ptr, cname, C.uint(mode.Perm()), nil, nil) if ret != 0 { return MakeGitError(ret) } return nil }