(
why, path_cstr, baseline, target, workdir, data: CheckoutCallbacks
)
| 736 | |
| 737 | @libgit2_callback |
| 738 | def _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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…