diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-06-07 17:14:57 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-07 17:14:57 +0200 |
commit | f7ca1ce511b535b088ffcbd764415fe0d33f368e (patch) | |
tree | 57d0d3ea2dbc8c0306f301712799126c09d686f7 /git/objects/submodule/base.py | |
parent | 93668b0f672bc85f59b943b7a105dd042defd55d (diff) | |
download | gitpython-f7ca1ce511b535b088ffcbd764415fe0d33f368e.tar.gz |
Submodule tests are nearly working. Only root module needs more attention
Diffstat (limited to 'git/objects/submodule/base.py')
-rw-r--r-- | git/objects/submodule/base.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index c1cc51aa..019fe18c 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -29,7 +29,7 @@ from git.exc import ( ) import stat -import git +import git # we use some types indirectly to prevent cyclic imports ! import os import sys @@ -769,14 +769,18 @@ class Submodule(util.IndexObject, Iterable, Traversable, RepoAliasMixin): #{ Query Interface @unbare_repo - def module(self): - """:return: Repo instance initialized from the repository at our submodule path + def module(self, repoType=None): + """:return: Repository instance initialized from the repository at our submodule path + :param repoType: The type of repository to be created. It must be possible to instatiate it + from a single repository path. + If None, a default repository type will be used :raise InvalidGitRepositoryError: if a repository was not available. This could also mean that it was not yet initialized""" # late import to workaround circular dependencies - module_path = self.abspath + module_path = self.abspath + repoType = repoType or git.Repo try: - repo = git.Repo(module_path) + repo = repoType(module_path) if repo != self.repo: return repo # END handle repo uninitialized |