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

Function diffForEachFileCallback

diff.go:356–374  ·  view source on GitHub ↗

export diffForEachFileCallback

(delta *C.git_diff_delta, progress C.float, handle unsafe.Pointer)

Source from the content-addressed store, hash-verified

354
355//export diffForEachFileCallback
356func diffForEachFileCallback(delta *C.git_diff_delta, progress C.float, handle unsafe.Pointer) C.int {
357 payload := pointerHandles.Get(handle)
358 data, ok := payload.(*diffForEachCallbackData)
359 if !ok {
360 panic("could not retrieve data for handle")
361 }
362
363 data.hunkCallback = nil
364 if data.fileCallback != nil {
365 cb, err := data.fileCallback(diffDeltaFromC(delta), float64(progress))
366 if err != nil {
367 *data.errorTarget = err
368 return C.int(ErrorCodeUser)
369 }
370 data.hunkCallback = cb
371 }
372
373 return C.int(ErrorCodeOK)
374}
375
376type DiffForEachHunkCallback func(DiffHunk) (DiffForEachLineCallback, error)
377

Callers

nothing calls this directly

Calls 2

diffDeltaFromCFunction · 0.85
GetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…