Skip to content

Commit 8900f2a

Browse files
committed
Make pathlike a forward ref
1 parent dcfedb2 commit 8900f2a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: .flake8

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ enable-extensions = TC, TC2 # only needed for extensions not enabled by default
1919
ignore = E265,E266,E731,E704,
2020
W293, W504,
2121
ANN0 ANN1 ANN2,
22-
TC002, # TC0, TC1, TC2
22+
TC002,
23+
# TC0, TC1, TC2
2324
# B,
2425
A,
2526
D,

Diff for: git/repo/fun.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
from typing import Union, Optional, cast, TYPE_CHECKING
2121

22+
2223
if TYPE_CHECKING:
2324
from git.types import PathLike
2425
from .base import Repo
@@ -38,7 +39,7 @@ def touch(filename: str) -> str:
3839
return filename
3940

4041

41-
def is_git_dir(d: PathLike) -> bool:
42+
def is_git_dir(d: 'PathLike') -> bool:
4243
""" This is taken from the git setup.c:is_git_directory
4344
function.
4445
@@ -60,7 +61,7 @@ def is_git_dir(d: PathLike) -> bool:
6061
return False
6162

6263

63-
def find_worktree_git_dir(dotgit: PathLike) -> Optional[str]:
64+
def find_worktree_git_dir(dotgit: 'PathLike') -> Optional[str]:
6465
"""Search for a gitdir for this worktree."""
6566
try:
6667
statbuf = os.stat(dotgit)
@@ -79,7 +80,7 @@ def find_worktree_git_dir(dotgit: PathLike) -> Optional[str]:
7980
return None
8081

8182

82-
def find_submodule_git_dir(d: PathLike) -> Optional[PathLike]:
83+
def find_submodule_git_dir(d: 'PathLike') -> Optional['PathLike']:
8384
"""Search for a submodule repo."""
8485
if is_git_dir(d):
8586
return d

0 commit comments

Comments
 (0)