Example #1
0
func (i *GitIndex) Rm(file string) error {
	cfile := C.CString(file)
	defer C.free(unsafe.Pointer(cfile))

	ret := C.git_index_remove_bypath(i.ptr, cfile)
	if ret < 0 {
		return GitErrorLast()
	}

	return i.Write()
}
Example #2
0
File: index.go Project: wid/git2go
func (v *Index) RemoveByPath(path string) error {
	cstr := C.CString(path)
	defer C.free(unsafe.Pointer(cstr))

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_index_remove_bypath(v.ptr, cstr)
	if ret < 0 {
		return MakeGitError(ret)
	}

	return nil
}