55# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66import util
77from base import IndexObject
8-
8+ from git . util import join_path
99from blob import Blob
1010from submodule import Submodule
1111import git .diff as diff
1717
1818from gitdb .util import (
1919 to_bin_sha ,
20- join
2120 )
2221
2322__all__ = ("TreeModifier" , "Tree" )
@@ -152,7 +151,7 @@ def _iter_convert_to_object(self, iterable):
152151 """Iterable yields tuples of (binsha, mode, name), which will be converted
153152 to the respective object representation"""
154153 for binsha , mode , name in iterable :
155- path = join (self .path , name )
154+ path = join_path (self .path , name )
156155 try :
157156 yield self ._map_id_to_type [mode >> 12 ](self .repo , binsha , mode , path )
158157 except KeyError :
@@ -186,7 +185,7 @@ def __div__(self, file):
186185 else :
187186 for info in self ._cache :
188187 if info [2 ] == file : # [2] == name
189- return self ._map_id_to_type [info [1 ] >> 12 ](self .repo , info [0 ], info [1 ], join (self .path , info [2 ]))
188+ return self ._map_id_to_type [info [1 ] >> 12 ](self .repo , info [0 ], info [1 ], join_path (self .path , info [2 ]))
190189 # END for each obj
191190 raise KeyError ( msg % file )
192191 # END handle long paths
@@ -231,7 +230,7 @@ def __len__(self):
231230 def __getitem__ (self , item ):
232231 if isinstance (item , int ):
233232 info = self ._cache [item ]
234- return self ._map_id_to_type [info [1 ] >> 12 ](self .repo , info [0 ], info [1 ], join (self .path , info [2 ]))
233+ return self ._map_id_to_type [info [1 ] >> 12 ](self .repo , info [0 ], info [1 ], join_path (self .path , info [2 ]))
235234
236235 if isinstance (item , basestring ):
237236 # compatability
@@ -254,7 +253,7 @@ def __contains__(self, item):
254253 # treat item as repo-relative path
255254 path = self .path
256255 for info in self ._cache :
257- if item == join (path , info [2 ]):
256+ if item == join_path (path , info [2 ]):
258257 return True
259258 # END for each item
260259 return False
0 commit comments