Skip to content

Commit ad1ae5f

Browse files
committed
Simplify logic with direct path conversion
1 parent 24abf10 commit ad1ae5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git/index/typ.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def __init__(self, paths: Sequence[PathLike]) -> None:
5858

5959
def __call__(self, stage_blob: Tuple[StageType, Blob]) -> bool:
6060
blob_pathlike: PathLike = stage_blob[1].path
61-
blob_path: Path = blob_pathlike if isinstance(blob_pathlike, Path) else Path(blob_pathlike)
61+
blob_path = Path(blob_pathlike)
6262
for pathlike in self.paths:
63-
path: Path = pathlike if isinstance(pathlike, Path) else Path(pathlike)
63+
path = Path(pathlike)
6464
# TODO: Change to use `PosixPath.is_relative_to` once Python 3.8 is no
6565
# longer supported.
6666
filter_parts = path.parts

0 commit comments

Comments
 (0)