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

Function diffForEachLineCallback

diff.go:402–416  ·  view source on GitHub ↗

export diffForEachLineCallback

(delta *C.git_diff_delta, hunk *C.git_diff_hunk, line *C.git_diff_line, handle unsafe.Pointer)

Source from the content-addressed store, hash-verified

400
401//export diffForEachLineCallback
402func diffForEachLineCallback(delta *C.git_diff_delta, hunk *C.git_diff_hunk, line *C.git_diff_line, handle unsafe.Pointer) C.int {
403 payload := pointerHandles.Get(handle)
404 data, ok := payload.(*diffForEachCallbackData)
405 if !ok {
406 panic("could not retrieve data for handle")
407 }
408
409 err := data.lineCallback(diffLineFromC(line))
410 if err != nil {
411 *data.errorTarget = err
412 return C.int(ErrorCodeUser)
413 }
414
415 return C.int(ErrorCodeOK)
416}
417
418func (diff *Diff) Patch(deltaIndex int) (*Patch, error) {
419 if diff.ptr == nil {

Callers

nothing calls this directly

Calls 2

diffLineFromCFunction · 0.85
GetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…