You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Passing checkout_branch to pygit2.clone_repository() triggers a fatal error #399
The entire contents of the repo are staged for deletion.
I tried to get around this by passing 'checkout_branch="master"' to the clone_repository() function (as this fixes the issue just fine when I run 'git checkout master' from my shell), but that triggers a fatal error.
Traceback (most recent call last):
File "modman.py", line 8, in <module>
repo = git.clone_repository(url="file:///srv/samba/files/programming/cli/modman-test", path="/tmp/modman", checkout_branch="master")
File "/usr/lib/python3.4/site-packages/pygit2/__init__.py", line 156, in clone_repository
checkout_branch_ref = ffi.new('char []', branch)
File "/usr/lib/python3.4/site-packages/cffi/api.py", line 225, in new
return self._backend.newp(cdecl, init)
TypeError: initializer for ctype 'char[]' must be a bytes or list or tuple, not str
I've just discovered that the "test_clone_checkout_branch" test in the repository test suite is commented out because it's broken, which probably explains why this use case isn't working for me.
I feel like the documentation should be updated to reflect this until it is fixed, as it can be quite frustrating for someone who doesn't know.
The test is commented out for a different reason, explained in the comment block. As you can see from the error message, the issue here is down to a type mismatch, which looks like a missing to_bytes() when setting up the struct.
Activity
carlosmn commentedon Aug 5, 2014
Which error? Which is the active branch in the source repository?
djmattyg007 commentedon Aug 5, 2014
The active branch is
master. This is line of code I'm trying to run:And this is the full error I get:
djmattyg007 commentedon Aug 23, 2014
I've just discovered that the "test_clone_checkout_branch" test in the repository test suite is commented out because it's broken, which probably explains why this use case isn't working for me.
I feel like the documentation should be updated to reflect this until it is fixed, as it can be quite frustrating for someone who doesn't know.
carlosmn commentedon Aug 25, 2014
The test is commented out for a different reason, explained in the comment block. As you can see from the error message, the issue here is down to a type mismatch, which looks like a missing
to_bytes()when setting up the struct.Fix cloning a repository with a particular branch to checkout