diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-06 14:06:59 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-06 14:06:59 +0100 |
commit | 3ce319f1296a5402079e9280500e96cc1d12fd04 (patch) | |
tree | c1c6f6684fa55c2509750377fcdc15e9dcb1018a /git/util.py | |
parent | a9351347d704db02bd3d1103e9715ff6a999e3f9 (diff) | |
download | gitpython-3ce319f1296a5402079e9280500e96cc1d12fd04.tar.gz |
Add types to submodule.update()
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git/util.py b/git/util.py index abc82bd3..b13af358 100644 --- a/git/util.py +++ b/git/util.py @@ -82,13 +82,15 @@ HIDE_WINDOWS_FREEZE_ERRORS = is_win and os.environ.get('HIDE_WINDOWS_FREEZE_ERRO #{ Utility Methods +T = TypeVar('T') -def unbare_repo(func: Callable) -> Callable: + +def unbare_repo(func: Callable[..., T]) -> Callable[..., T]: """Methods with this decorator raise InvalidGitRepositoryError if they encounter a bare repository""" @wraps(func) - def wrapper(self: 'Remote', *args: Any, **kwargs: Any) -> Callable: + def wrapper(self: 'Remote', *args: Any, **kwargs: Any) -> T: if self.repo.bare: raise InvalidGitRepositoryError("Method '%s' cannot operate on bare repositories" % func.__name__) # END bare method |