func (i *GitIndex) Add(file string) error { cfile := C.CString(file) defer C.free(unsafe.Pointer(cfile)) ret := C.git_index_add_bypath(i.ptr, cfile) if ret < 0 { return GitErrorLast() } return i.Write() }
func (v *Index) AddByPath(path string) error { cstr := C.CString(path) defer C.free(unsafe.Pointer(cstr)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_index_add_bypath(v.ptr, cstr) if ret < 0 { return MakeGitError(ret) } return nil }