diff options
author | Remi Rampin <remirampin@gmail.com> | 2014-04-24 14:03:25 -0400 |
---|---|---|
committer | Remi Rampin <remirampin@gmail.com> | 2014-04-24 14:03:25 -0400 |
commit | ec0b85e2d4907fb5fcfc5724e0e8df59e752c0d1 (patch) | |
tree | 87a6fe7b21d40b3544a9815e537a6b8997694ca0 /git/repo/base.py | |
parent | e6a2942a982c2541a6b6f7c67aa7dbf57ed060ca (diff) | |
download | gitpython-ec0b85e2d4907fb5fcfc5724e0e8df59e752c0d1.tar.gz |
Fixes creating a Repo for a submodule
Fixes #155.
Diffstat (limited to 'git/repo/base.py')
-rw-r--r-- | git/repo/base.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index 3bbcdb59..9ac471a6 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -32,6 +32,7 @@ from gitdb.util import ( from fun import ( rev_parse, is_git_dir, + find_git_dir, touch ) @@ -108,8 +109,8 @@ class Repo(object): self.git_dir = curpath self._working_tree_dir = os.path.dirname(curpath) break - gitpath = join(curpath, '.git') - if is_git_dir(gitpath): + gitpath = find_git_dir(join(curpath, '.git')) + if gitpath is not None: self.git_dir = gitpath self._working_tree_dir = curpath break @@ -119,7 +120,7 @@ class Repo(object): # END while curpath if self.git_dir is None: - raise InvalidGitRepositoryError(epath) + raise InvalidGitRepositoryError(epath) self._bare = False try: |