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

Method Find

index.go:484–498  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

482}
483
484func (v *Index) Find(path string) (uint, error) {
485 cpath := C.CString(path)
486 defer C.free(unsafe.Pointer(cpath))
487
488 runtime.LockOSThread()
489 defer runtime.UnlockOSThread()
490
491 var pos C.size_t
492 ret := C.git_index_find(&pos, v.ptr, cpath)
493 runtime.KeepAlive(v)
494 if ret < 0 {
495 return uint(0), MakeGitError(ret)
496 }
497 return uint(pos), nil
498}
499
500func (v *Index) FindPrefix(prefix string) (uint, error) {
501 cprefix := C.CString(prefix)

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected