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

Function git_fetch_options

pygit2/callbacks.py:377–398  ·  view source on GitHub ↗
(payload, opts=None)

Source from the content-addressed store, hash-verified

375
376@contextmanager
377def 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

Callers 4

clone_repositoryFunction · 0.85
updateMethod · 0.85
addMethod · 0.85
fetchMethod · 0.85

Calls 1

RemoteCallbacksClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…