Skip to content

Commit 52654c0

Browse files
committed
repo: these changes make Govind's latest changes pass the test cases
Signed-off-by: David Aguilar <davvid@gmail.com>
1 parent c508375 commit 52654c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/git/repo.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ def __init__(self, path=None):
2727
Returns
2828
``GitPython.Repo``
2929
"""
30+
if not os.path.exists(path):
31+
raise NoSuchPathError(path)
32+
3033
self.git = Git(path)
31-
epath = self.git.get_work_tree()
3234
self.path = self.git.get_git_dir()
35+
if not self.path:
36+
raise InvalidGitRepositoryError(path)
37+
epath = self.git.get_work_tree()
3338

3439
if os.path.exists(os.path.join(epath, '.git')):
3540
self.bare = False

0 commit comments

Comments
 (0)