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

Function git_clone_options

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

Source from the content-addressed store, hash-verified

353
354@contextmanager
355def git_clone_options(payload, opts=None):
356 if opts is None:
357 opts = ffi.new('git_clone_options *')
358 C.git_clone_options_init(opts, C.GIT_CLONE_OPTIONS_VERSION)
359
360 handle = ffi.new_handle(payload)
361
362 # Plug callbacks
363 if payload.repository:
364 opts.repository_cb = C._repository_create_cb
365 opts.repository_cb_payload = handle
366 if payload.remote:
367 opts.remote_cb = C._remote_create_cb
368 opts.remote_cb_payload = handle
369
370 # Give back control
371 payload._stored_exception = None
372 payload.clone_options = opts
373 yield payload
374
375
376@contextmanager

Callers 1

clone_repositoryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…