MCPcopy Create free account
hub / github.com/libgit2/git2go / RemoveByPath

Method RemoveByPath

index.go:354–368  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

352}
353
354func (v *Index) RemoveByPath(path string) error {
355 cstr := C.CString(path)
356 defer C.free(unsafe.Pointer(cstr))
357
358 runtime.LockOSThread()
359 defer runtime.UnlockOSThread()
360
361 ret := C.git_index_remove_bypath(v.ptr, cstr)
362 runtime.KeepAlive(v)
363 if ret < 0 {
364 return MakeGitError(ret)
365 }
366
367 return nil
368}
369
370// RemoveDirectory removes all entries from the index under a given directory.
371func (v *Index) RemoveDirectory(dir string, stage int) error {

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected