(payload, opts=None)
| 353 | |
| 354 | @contextmanager |
| 355 | def 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…