Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc80e6b

Browse filesBrowse files
committed
Remove usage of PosixPath.is_relative_to
Remove usage of `PosixPath.is_relative_to` because it was added in Python 3.9 and earlier versions of Python are supported by `GitPython`.
1 parent c6a018b commit cc80e6b
Copy full SHA for cc80e6b

1 file changed

+2-1Lines changed: 2 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎git/index/typ.py‎

Copy file name to clipboardExpand all lines: git/index/typ.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def __call__(self, stage_blob: Tuple[StageType, Blob]) -> bool:
5656
blob_path: Path = blob_pathlike if isinstance(blob_pathlike, Path) else Path(blob_pathlike)
5757
for pathlike in self.paths:
5858
path: Path = pathlike if isinstance(pathlike, Path) else Path(pathlike)
59-
if path.is_relative_to(blob_path):
59+
# TODO: Change to use `PosixPath.is_relative_to` once Python 3.8 is no longer supported.
60+
if all(map(lambda t: t[0] == t[1], zip(path.parts, blob_path.parts))):
6061
return True
6162
return False
6263

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.