(path string)
| 482 | } |
| 483 | |
| 484 | func (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 | |
| 500 | func (v *Index) FindPrefix(prefix string) (uint, error) { |
| 501 | cprefix := C.CString(prefix) |
nothing calls this directly
no test coverage detected