summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-19 19:57:34 +0100
committerYobmod <yobmod@gmail.com>2021-07-19 19:57:34 +0100
commit8900f2a5c6ab349af19960a333ee55718065304b (patch)
treef4f9688eb50aaa5becfce3979054de58a4157305
parentdcfedb27dc720683bbadb7353d96cfec2a99c476 (diff)
downloadgitpython-8900f2a5c6ab349af19960a333ee55718065304b.tar.gz
Make pathlike a forward ref
-rw-r--r--.flake83
-rw-r--r--git/repo/fun.py7
2 files changed, 6 insertions, 4 deletions
diff --git a/.flake8 b/.flake8
index e22e8de0..3cf342f9 100644
--- a/.flake8
+++ b/.flake8
@@ -19,7 +19,8 @@ enable-extensions = TC, TC2 # only needed for extensions not enabled by default
ignore = E265,E266,E731,E704,
W293, W504,
ANN0 ANN1 ANN2,
- TC002, # TC0, TC1, TC2
+ TC002,
+ # TC0, TC1, TC2
# B,
A,
D,
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