(payload)
| 456 | |
| 457 | @contextmanager |
| 458 | def git_remote_callbacks(payload): |
| 459 | if payload is None: |
| 460 | payload = RemoteCallbacks() |
| 461 | |
| 462 | cdata = ffi.new('git_remote_callbacks *') |
| 463 | C.git_remote_init_callbacks(cdata, C.GIT_REMOTE_CALLBACKS_VERSION) |
| 464 | |
| 465 | # Plug callbacks |
| 466 | cdata.credentials = C._credentials_cb |
| 467 | cdata.update_tips = C._update_tips_cb |
| 468 | cdata.certificate_check = C._certificate_check_cb |
| 469 | # Payload |
| 470 | handle = ffi.new_handle(payload) |
| 471 | cdata.payload = handle |
| 472 | |
| 473 | # Give back control |
| 474 | payload._stored_exception = None |
| 475 | payload.remote_callbacks = cdata |
| 476 | yield payload |
| 477 | |
| 478 | |
| 479 | # |
no test coverage detected
searching dependent graphs…