We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fa28ae commit 88e2614Copy full SHA for 88e2614
1 file changed
git/objects/tree.py
@@ -5,6 +5,7 @@
5
6
__all__ = ["TreeModifier", "Tree"]
7
8
+import os
9
import sys
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
232
# END for each item
233
- def join(self, file: str) -> IndexObjUnion:
234
+ def join(self, file: PathLike) -> IndexObjUnion:
235
"""Find the named object in this tree's contents.
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.
243
"""
244
msg = "Blob or Tree named %r not found"
245
+ file = os.fspath(file)
246
if "/" in file:
247
tree = self
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
273
- def __truediv__(self, file: str) -> IndexObjUnion:
274
+ def __truediv__(self, file: PathLike) -> IndexObjUnion:
275
"""The ``/`` operator is another syntax for joining.
276
277
See :meth:`join` for details.
0 commit comments