diff options
Diffstat (limited to 'git/objects')
-rw-r--r-- | git/objects/submodule/base.py | 4 | ||||
-rw-r--r-- | git/objects/submodule/util.py | 16 |
2 files changed, 3 insertions, 17 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index cd7d4ec4..94322a55 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -3,7 +3,6 @@ from .util import ( mkhead, sm_name, sm_section, - unbare_repo, SubmoduleConfigParser, find_first_remote_branch ) @@ -14,7 +13,8 @@ from git.util import ( join_path_native, to_native_path_linux, RemoteProgress, - rmtree + rmtree, + unbare_repo ) from git.config import ( diff --git a/git/objects/submodule/util.py b/git/objects/submodule/util.py index 8b9873fc..0b4ce3c5 100644 --- a/git/objects/submodule/util.py +++ b/git/objects/submodule/util.py @@ -4,7 +4,7 @@ from git.config import GitConfigParser from io import BytesIO import weakref -__all__ = ('sm_section', 'sm_name', 'mkhead', 'unbare_repo', 'find_first_remote_branch', +__all__ = ('sm_section', 'sm_name', 'mkhead', 'find_first_remote_branch', 'SubmoduleConfigParser') #{ Utilities @@ -26,20 +26,6 @@ def mkhead(repo, path): return git.Head(repo, git.Head.to_full_path(path)) -def unbare_repo(func): - """Methods with this decorator raise InvalidGitRepositoryError if they - encounter a bare repository""" - - def wrapper(self, *args, **kwargs): - if self.repo.bare: - raise InvalidGitRepositoryError("Method '%s' cannot operate on bare repositories" % func.__name__) - # END bare method - return func(self, *args, **kwargs) - # END wrapper - wrapper.__name__ = func.__name__ - return wrapper - - def find_first_remote_branch(remotes, branch_name): """Find the remote branch matching the name of the given branch or raise InvalidGitRepositoryError""" for remote in remotes: |