예제 #1
0
파일: tree.go 프로젝트: jgrocho/go-git2
func (builder *TreeBuilder) Remove(filename string) error {
	cfilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cfilename))
	ecode := C.git_treebuilder_remove(builder.git_treebuilder, cfilename)
	if ecode != git_SUCCESS {
		return gitError()
	}
	return nil
}
예제 #2
0
파일: tree.go 프로젝트: kissthink/git2go
func (v *TreeBuilder) Remove(filename string) error {
	cfilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cfilename))

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	err := C.git_treebuilder_remove(v.ptr, cfilename)
	if err < 0 {
		return MakeGitError(err)
	}

	return nil
}