libgit2/pygit2

clone_repository() function not working

gmpuran opened this issue · 5 comments

Example given in the docs for clone repository results in empty repository at mentioned path.

from pygit2 import clone_repository
repo_url = 'git://github.com/libgit2/pygit2.git'
repo_path = '/path/to/create/repository'
repo = clone_repository(repo_url, repo_path) # Clones a non-bare repository

Code execution doesn't yield any errors, any clues?

Which version are you using?

Hi pypingou,

pygit2 - v0.21.2
libgit2 - v0.21.0

It looks to be down to us not overriding the default checkout strategy, which is a no-op.

Or rather, by not initializing with libgit2's defaults, which makes it checkout by default.

FTR the repository isn't empty, just its worktree.