MCPcopy Create free account
hub / github.com/libgit2/pygit2 / _checkout_notify_cb

Function _checkout_notify_cb

pygit2/callbacks.py:738–757  ·  view source on GitHub ↗
(
    why, path_cstr, baseline, target, workdir, data: CheckoutCallbacks
)

Source from the content-addressed store, hash-verified

736
737@libgit2_callback
738def _checkout_notify_cb(
739 why, path_cstr, baseline, target, workdir, data: CheckoutCallbacks
740):
741 pypath = maybe_string(path_cstr)
742 pybaseline = DiffFile.from_c(ptr_to_bytes(baseline))
743 pytarget = DiffFile.from_c(ptr_to_bytes(target))
744 pyworkdir = DiffFile.from_c(ptr_to_bytes(workdir))
745
746 try:
747 data.checkout_notify(why, pypath, pybaseline, pytarget, pyworkdir) # type: ignore[arg-type]
748 except Passthrough:
749 # Unlike most other operations with optional callbacks, checkout
750 # doesn't support the GIT_PASSTHROUGH return code, so we must bypass
751 # libgit2_callback's error handling and return 0 explicitly here.
752 pass
753
754 # If the user's callback has raised any other exception type,
755 # it's caught by the libgit2_callback decorator by now.
756 # So, return success code to libgit2.
757 return 0
758
759
760@libgit2_callback_void

Callers

nothing calls this directly

Calls 4

maybe_stringFunction · 0.85
ptr_to_bytesFunction · 0.85
from_cMethod · 0.45
checkout_notifyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…