From 3ce319f1296a5402079e9280500e96cc1d12fd04 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Tue, 6 Jul 2021 14:06:59 +0100 Subject: Add types to submodule.update() --- git/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'git/util.py') 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 -- cgit v1.2.1