summaryrefslogtreecommitdiff
path: root/lib/git/repo.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r--lib/git/repo.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/git/repo.py b/lib/git/repo.py
index 72291dc9..8b519c1c 100644
--- a/lib/git/repo.py
+++ b/lib/git/repo.py
@@ -27,9 +27,14 @@ class Repo(object):
Returns
``GitPython.Repo``
"""
+ if not os.path.exists(path):
+ raise NoSuchPathError(path)
+
self.git = Git(path)
- epath = self.git.get_work_tree()
self.path = self.git.get_git_dir()
+ if not self.path:
+ raise InvalidGitRepositoryError(path)
+ epath = self.git.get_work_tree()
if os.path.exists(os.path.join(epath, '.git')):
self.bare = False