Skip to content

clone_from not working as documented #270

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

Closed
tardis4500 opened this issue Mar 11, 2015 · 3 comments
Closed

clone_from not working as documented #270

tardis4500 opened this issue Mar 11, 2015 · 3 comments

Comments

@tardis4500
Copy link

I use git to create a repo in a subdirectory named 'test'
I try to clone this to a directory named test2 with GitPython using

from git import Repo
Repo.clone_from('test', 'test2')

but get the Traceback

Traceback (most recent call last):
File "", line 1, in
File "C:\BaRT\Python34\lib\site-packages\gitpython-0.3.6-py3.4.egg\git\repo\base.py", line 844, in clone_from
return cls._clone(Git(os.getcwd()), url, to_path, GitCmdObjectDB, progress,**kwargs)
File "C:\BaRT\Python34\lib\site-packages\gitpython-0.3.6-py3.4.egg\git\repo\base.py", line 814, in _clone
repo = cls(os.path.abspath(path), odbt=odbt)
File "C:\BaRT\Python34\lib\site-packages\gitpython-0.3.6-py3.4.egg\git\repo\base.py", line 130, in init
raise NoSuchPathError(epath)
git.exc.NoSuchPathError: C:\Users\jsmith\git\test2

If I create the directory first I get
Traceback (most recent call last):
File "", line 1, in
File "C:\BaRT\Python34\lib\site-packages\gitpython-0.3.6-py3.4.egg\git\repo\base.py", line 844, in clone_from
return cls._clone(Git(os.getcwd()), url, to_path, GitCmdObjectDB, progress,**kwargs)
File "C:\BaRT\Python34\lib\site-packages\gitpython-0.3.6-py3.4.egg\git\repo\base.py", line 814, in _clone
repo = cls(os.path.abspath(path), odbt=odbt)
File "C:\BaRT\Python34\lib\site-packages\gitpython-0.3.6-py3.4.egg\git\repo\base.py", line 162, in init
raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: C:\Users\jsmith\git\test2

@Byron
Copy link
Member

Byron commented Mar 11, 2015

How does that work ?

from git import Repo
Repo.clone_from(r"C:\Users\jsmith\git\test", 'test2')

@tardis4500
Copy link
Author

Still fails. I figured out that problem is that the git command was not on the path. I think in this case the Traceback should be clearer about the problem.

@Byron
Copy link
Member

Byron commented Mar 12, 2015

This seems to be something special on your system though, as, according to gitpython, the git clone command was executed successfully, even though it didn't do anything.
There is no way this can be detected, which is why I have to close this issue.

@Byron Byron closed this as completed Mar 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants