File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 55
66__all__ = ["TreeModifier" , "Tree" ]
77
8+ import os
89import sys
910
1011import git .diff as git_diff
@@ -230,7 +231,7 @@ def _iter_convert_to_object(self, iterable: Iterable[TreeCacheTup]) -> Iterator[
230231 raise TypeError ("Unknown mode %o found in tree data for path '%s'" % (mode , path )) from e
231232 # END for each item
232233
233- def join (self , file : str ) -> IndexObjUnion :
234+ def join (self , file : PathLike ) -> IndexObjUnion :
234235 """Find the named object in this tree's contents.
235236
236237 :return:
@@ -241,6 +242,7 @@ def join(self, file: str) -> IndexObjUnion:
241242 If the given file or tree does not exist in this tree.
242243 """
243244 msg = "Blob or Tree named %r not found"
245+ file = os .fspath (file )
244246 if "/" in file :
245247 tree = self
246248 item = self
@@ -269,7 +271,7 @@ def join(self, file: str) -> IndexObjUnion:
269271 raise KeyError (msg % file )
270272 # END handle long paths
271273
272- def __truediv__ (self , file : str ) -> IndexObjUnion :
274+ def __truediv__ (self , file : PathLike ) -> IndexObjUnion :
273275 """The ``/`` operator is another syntax for joining.
274276
275277 See :meth:`join` for details.
You can’t perform that action at this time.
0 commit comments