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

Method FindPrefix

index.go:500–514  ·  view source on GitHub ↗
(prefix string)

Source from the content-addressed store, hash-verified

498}
499
500func (v *Index) FindPrefix(prefix string) (uint, error) {
501 cprefix := C.CString(prefix)
502 defer C.free(unsafe.Pointer(cprefix))
503
504 runtime.LockOSThread()
505 defer runtime.UnlockOSThread()
506
507 var pos C.size_t
508 ret := C.git_index_find_prefix(&pos, v.ptr, cprefix)
509 runtime.KeepAlive(v)
510 if ret < 0 {
511 return uint(0), MakeGitError(ret)
512 }
513 return uint(pos), nil
514}
515
516func (v *Index) HasConflicts() bool {
517 ret := C.git_index_has_conflicts(v.ptr) != 0

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected