| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9fa28ae commit 88e2614
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | 6 | __all__ = ["TreeModifier", "Tree"] | |
| 7 | 7 | ||
| 8 | + import os | ||
| 8 | 9 | import sys | |
| 9 | 10 | ||
| 10 | 11 | import git.diff as git_diff | |
@@ -230,7 +231,7 @@ def _iter_convert_to_object(self, iterable: Iterable[TreeCacheTup]) -> Iterator[ | |||
| 230 | 231 | raise TypeError("Unknown mode %o found in tree data for path '%s'" % (mode, path)) from e | |
| 231 | 232 | # END for each item | |
| 232 | 233 | ||
| 233 | - def join(self, file: str) -> IndexObjUnion: | ||
| 234 | + def join(self, file: PathLike) -> IndexObjUnion: | ||
| 234 | 235 | """Find the named object in this tree's contents. | |
| 235 | 236 | ||
| 236 | 237 | :return: | |
@@ -241,6 +242,7 @@ def join(self, file: str) -> IndexObjUnion: | |||
| 241 | 242 | If the given file or tree does not exist in this tree. | |
| 242 | 243 | """ | |
| 243 | 244 | msg = "Blob or Tree named %r not found" | |
| 245 | + file = os.fspath(file) | ||
| 244 | 246 | if "/" in file: | |
| 245 | 247 | tree = self | |
| 246 | 248 | item = self | |
@@ -269,7 +271,7 @@ def join(self, file: str) -> IndexObjUnion: | |||
| 269 | 271 | raise KeyError(msg % file) | |
| 270 | 272 | # END handle long paths | |
| 271 | 273 | ||
| 272 | - def __truediv__(self, file: str) -> IndexObjUnion: | ||
| 274 | + def __truediv__(self, file: PathLike) -> IndexObjUnion: | ||
| 273 | 275 | """The ``/`` operator is another syntax for joining. | |
| 274 | 276 | ||
| 275 | 277 | See :meth:`join` for details. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments