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

Method RemoveDirectory

index.go:371–385  ·  view source on GitHub ↗

RemoveDirectory removes all entries from the index under a given directory.

(dir string, stage int)

Source from the content-addressed store, hash-verified

369
370// RemoveDirectory removes all entries from the index under a given directory.
371func (v *Index) RemoveDirectory(dir string, stage int) error {
372 cstr := C.CString(dir)
373 defer C.free(unsafe.Pointer(cstr))
374
375 runtime.LockOSThread()
376 defer runtime.UnlockOSThread()
377
378 ret := C.git_index_remove_directory(v.ptr, cstr, C.int(stage))
379 runtime.KeepAlive(v)
380 if ret < 0 {
381 return MakeGitError(ret)
382 }
383
384 return nil
385}
386
387func (v *Index) WriteTreeTo(repo *Repository) (*Oid, error) {
388 oid := new(Oid)

Callers 1

TestIndexRemoveDirectoryFunction · 0.95

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by 1

TestIndexRemoveDirectoryFunction · 0.76