(payload, opts=None)
| 375 | |
| 376 | @contextmanager |
| 377 | def git_fetch_options(payload, opts=None): |
| 378 | if payload is None: |
| 379 | payload = RemoteCallbacks() |
| 380 | |
| 381 | if opts is None: |
| 382 | opts = ffi.new('git_fetch_options *') |
| 383 | C.git_fetch_options_init(opts, C.GIT_FETCH_OPTIONS_VERSION) |
| 384 | |
| 385 | # Plug callbacks |
| 386 | opts.callbacks.sideband_progress = C._sideband_progress_cb |
| 387 | opts.callbacks.transfer_progress = C._transfer_progress_cb |
| 388 | opts.callbacks.update_tips = C._update_tips_cb |
| 389 | opts.callbacks.credentials = C._credentials_cb |
| 390 | opts.callbacks.certificate_check = C._certificate_check_cb |
| 391 | # Payload |
| 392 | handle = ffi.new_handle(payload) |
| 393 | opts.callbacks.payload = handle |
| 394 | |
| 395 | # Give back control |
| 396 | payload.fetch_options = opts |
| 397 | payload._stored_exception = None |
| 398 | yield payload |
| 399 | |
| 400 | |
| 401 | @contextmanager |
no test coverage detected
searching dependent graphs…