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
Failed to initialize repository while the path contains "~" #83
I have tried to initialize a repository using a short path which contains "~", a exception be raised:
>>> repo = git.Repo.init("~/test.git", bare=True)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File ".../lib/python2.7/site-packages/git/repo/base.py", line 657, in init
return Repo(path)
File ".../lib/python2.7/site-packages/git/repo/base.py", line 98, in __init__
raise NoSuchPathError(epath)
NoSuchPathError: /home/username/test.git
If I create the target directory first, it will be another exception:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File ".../lib/python2.7/site-packages/git/repo/base.py", line 657, in init
return Repo(path)
File ".../lib/python2.7/site-packages/git/repo/base.py", line 122, in __init__
raise InvalidGitRepositoryError(epath)
InvalidGitRepositoryError: /home/username/test.git
But while I use the full path without any character ~ instead of, it works.
Activity
Byron commentedon Nov 19, 2014
Even though I wouldn't expect git-python to handle "~", as it's functionality of the shell, I'd expect it to fail gracefully or to work.
Fixed test to actually use tilde and environment variables respectively.
Byron commentedon Jan 10, 2015
This issue is fixed, and verified by a new test-case.
Also there is a video on youtube showing the process of fixing the issue.