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

Method EntryByPath

index.go:468–482  ·  view source on GitHub ↗
(path string, stage int)

Source from the content-addressed store, hash-verified

466}
467
468func (v *Index) EntryByPath(path string, stage int) (*IndexEntry, error) {
469 cpath := C.CString(path)
470 defer C.free(unsafe.Pointer(cpath))
471
472 runtime.LockOSThread()
473 defer runtime.UnlockOSThread()
474
475 centry := C.git_index_get_bypath(v.ptr, cpath, C.int(stage))
476 if centry == nil {
477 return nil, MakeGitError(C.int(ErrorCodeNotFound))
478 }
479 ret := newIndexEntryFromC(centry)
480 runtime.KeepAlive(v)
481 return ret, nil
482}
483
484func (v *Index) Find(path string) (uint, error) {
485 cpath := C.CString(path)

Callers

nothing calls this directly

Calls 3

MakeGitErrorFunction · 0.85
newIndexEntryFromCFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected