summaryrefslogtreecommitdiff
path: root/git/repo/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/repo/base.py')
-rw-r--r--git/repo/base.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index a5bbaa64..5273d4b2 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -35,8 +35,9 @@ from fun import (
rev_parse,
is_git_dir,
find_git_dir,
- touch
- )
+ read_gitfile,
+ touch,
+ )
import os
import sys
@@ -52,7 +53,6 @@ __all__ = ('Repo', )
class Repo(object):
-
"""Represents a git repository and allows you to query references,
gather commit information, generate diffs, create and clone repositories query
the log.
@@ -117,6 +117,11 @@ class Repo(object):
self.git_dir = gitpath
self._working_tree_dir = curpath
break
+ gitpath = read_gitfile(curpath)
+ if gitpath:
+ self.git_dir = gitpath
+ self._working_tree_dir = curpath
+ break
curpath, dummy = os.path.split(curpath)
if not dummy:
break