Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clone_repository() function not working #425

Closed
gmpuran opened this issue Sep 13, 2014 · 5 comments · Fixed by #426
Closed

clone_repository() function not working #425

gmpuran opened this issue Sep 13, 2014 · 5 comments · Fixed by #426

Comments

@gmpuran
Copy link

gmpuran commented Sep 13, 2014

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?

@pypingou
Copy link

Which version are you using?

@gmpuran
Copy link
Author

gmpuran commented Sep 13, 2014

Hi pypingou,

pygit2 - v0.21.2
libgit2 - v0.21.0

@carlosmn
Copy link
Member

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

@carlosmn
Copy link
Member

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

carlosmn added a commit to carlosmn/pygit2 that referenced this issue Sep 13, 2014
libgit2 provides an initialization function to set sane defaults. Use
that instead of setting the version by hand, as that's not the only
thing it does.

Using C.git_clone_init_options() sets the checkout strategy to SAFE,
which will checkout the files after the clone, instead of the implicit
NONE which we're setting by hand.

This fixes libgit2#425,
@carlosmn
Copy link
Member

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

carlosmn added a commit to carlosmn/pygit2 that referenced this issue Sep 13, 2014
libgit2 provides an initialization function to set sane defaults. Use
that instead of setting the version by hand, as that's not the only
thing it does.

Using C.git_clone_init_options() sets the checkout strategy to SAFE,
which will checkout the files after the clone, instead of the implicit
NONE which we're setting by hand.

This fixes libgit2#425,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants