We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c508375 commit 52654c0Copy full SHA for 52654c0
lib/git/repo.py
@@ -27,9 +27,14 @@ def __init__(self, path=None):
27
Returns
28
``GitPython.Repo``
29
"""
30
+ if not os.path.exists(path):
31
+ raise NoSuchPathError(path)
32
+
33
self.git = Git(path)
- epath = self.git.get_work_tree()
34
self.path = self.git.get_git_dir()
35
+ if not self.path:
36
+ raise InvalidGitRepositoryError(path)
37
+ epath = self.git.get_work_tree()
38
39
if os.path.exists(os.path.join(epath, '.git')):
40
self.bare = False
0 commit comments