diff options
author | Austin Scola <austinscola@gmail.com> | 2022-06-26 17:01:32 -0400 |
---|---|---|
committer | Austin Scola <austinscola@gmail.com> | 2022-06-26 17:01:32 -0400 |
commit | cc80e6bbb0b98d71f44846d66a8e9439b60efa42 (patch) | |
tree | 13127695dd25403a7a93241f9c00b8bbd78a85b7 /git/index/typ.py | |
parent | c6a018bdf802326f89e8c93ccac79fae78d94974 (diff) | |
download | gitpython-cc80e6bbb0b98d71f44846d66a8e9439b60efa42.tar.gz |
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`.
Diffstat (limited to 'git/index/typ.py')
-rw-r--r-- | git/index/typ.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/git/index/typ.py b/git/index/typ.py index 7f5dcc10..11077454 100644 --- a/git/index/typ.py +++ b/git/index/typ.py @@ -56,7 +56,8 @@ class BlobFilter(object): blob_path: Path = blob_pathlike if isinstance(blob_pathlike, Path) else Path(blob_pathlike) for pathlike in self.paths: path: Path = pathlike if isinstance(pathlike, Path) else Path(pathlike) - if path.is_relative_to(blob_path): + # TODO: Change to use `PosixPath.is_relative_to` once Python 3.8 is no longer supported. + if all(map(lambda t: t[0] == t[1], zip(path.parts, blob_path.parts))): return True return False |