diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-19 19:57:34 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-19 19:57:34 +0100 |
commit | 8900f2a5c6ab349af19960a333ee55718065304b (patch) | |
tree | f4f9688eb50aaa5becfce3979054de58a4157305 /git/repo/fun.py | |
parent | dcfedb27dc720683bbadb7353d96cfec2a99c476 (diff) | |
download | gitpython-8900f2a5c6ab349af19960a333ee55718065304b.tar.gz |
Make pathlike a forward ref
Diffstat (limited to 'git/repo/fun.py')
-rw-r--r-- | git/repo/fun.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/git/repo/fun.py b/git/repo/fun.py index a20e2ecb..7d5c7823 100644 --- a/git/repo/fun.py +++ b/git/repo/fun.py @@ -19,6 +19,7 @@ from git.cmd import Git from typing import Union, Optional, cast, TYPE_CHECKING + if TYPE_CHECKING: from git.types import PathLike from .base import Repo @@ -38,7 +39,7 @@ def touch(filename: str) -> str: return filename -def is_git_dir(d: PathLike) -> bool: +def is_git_dir(d: 'PathLike') -> bool: """ This is taken from the git setup.c:is_git_directory function. @@ -60,7 +61,7 @@ def is_git_dir(d: PathLike) -> bool: return False -def find_worktree_git_dir(dotgit: PathLike) -> Optional[str]: +def find_worktree_git_dir(dotgit: 'PathLike') -> Optional[str]: """Search for a gitdir for this worktree.""" try: statbuf = os.stat(dotgit) @@ -79,7 +80,7 @@ def find_worktree_git_dir(dotgit: PathLike) -> Optional[str]: return None -def find_submodule_git_dir(d: PathLike) -> Optional[PathLike]: +def find_submodule_git_dir(d: 'PathLike') -> Optional['PathLike']: """Search for a submodule repo.""" if is_git_dir(d): return d |