diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-06 14:25:23 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-06 14:25:23 +0100 |
commit | 647101833ae276f3b923583e202faa3f7d78e218 (patch) | |
tree | 298db9f851fe2f4adc4e48554ca2a79f6faf2da8 /git/index/util.py | |
parent | 3ce319f1296a5402079e9280500e96cc1d12fd04 (diff) | |
download | gitpython-647101833ae276f3b923583e202faa3f7d78e218.tar.gz |
Improve types of @unbare_repo and @git_working_dir decorators
Diffstat (limited to 'git/index/util.py')
-rw-r--r-- | git/index/util.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git/index/util.py b/git/index/util.py index 471e9262..e0daef0c 100644 --- a/git/index/util.py +++ b/git/index/util.py @@ -13,7 +13,7 @@ import os.path as osp from typing import (Any, Callable) -from git.types import PathLike +from git.types import PathLike, _T # --------------------------------------------------------------------------------- @@ -88,12 +88,12 @@ def default_index(func: Callable[..., Any]) -> Callable[..., Any]: return check_default_index -def git_working_dir(func: Callable[..., Any]) -> Callable[..., None]: +def git_working_dir(func: Callable[..., _T]) -> Callable[..., _T]: """Decorator which changes the current working dir to the one of the git repository in order to assure relative paths are handled correctly""" @wraps(func) - def set_git_working_dir(self, *args: Any, **kwargs: Any) -> None: + def set_git_working_dir(self, *args: Any, **kwargs: Any) -> _T: cur_wd = os.getcwd() os.chdir(self.repo.working_tree_dir) try: |