Fix type hints · gitpython-developers/GitPython@8434967 · GitHub
Skip to content

Commit 8434967

Browse files
committed
Fix type hints
1 parent 12e15ba commit 8434967

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

git/index/base.py

Lines changed: 5 additions & 5 deletions

git/index/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# typing ----------------------------------------------------------------------
1717

18-
from typing import Any, Callable, TYPE_CHECKING, Optional, Type
18+
from typing import Any, Callable, TYPE_CHECKING, Optional, Type, cast
1919

2020
from git.types import Literal, PathLike, _T
2121

@@ -106,7 +106,7 @@ def git_working_dir(func: Callable[..., _T]) -> Callable[..., _T]:
106106
@wraps(func)
107107
def set_git_working_dir(self: "IndexFile", *args: Any, **kwargs: Any) -> _T:
108108
cur_wd = os.getcwd()
109-
os.chdir(self.repo.working_tree_dir)
109+
os.chdir(cast(PathLike, self.repo.working_tree_dir))
110110
try:
111111
return func(self, *args, **kwargs)
112112
finally:

git/objects/submodule/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def _clone_repo(
352352
module_abspath_dir = osp.dirname(module_abspath)
353353
if not osp.isdir(module_abspath_dir):
354354
os.makedirs(module_abspath_dir)
355-
module_checkout_path = osp.join(repo.working_tree_dir, path)
355+
module_checkout_path = osp.join(repo.working_tree_dir, path) # type: ignore[arg-type]
356356

357357
if url.startswith("../"):
358358
remote_name = cast("RemoteReference", repo.active_branch.tracking_branch()).remote_name

git/refs/symbolic.py

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)