5
5
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6
6
import util
7
7
from base import IndexObject
8
-
8
+ from git . util import join_path
9
9
from blob import Blob
10
10
from submodule import Submodule
11
11
import git .diff as diff
17
17
18
18
from gitdb .util import (
19
19
to_bin_sha ,
20
- join
21
20
)
22
21
23
22
__all__ = ("TreeModifier" , "Tree" )
@@ -152,7 +151,7 @@ def _iter_convert_to_object(self, iterable):
152
151
"""Iterable yields tuples of (binsha, mode, name), which will be converted
153
152
to the respective object representation"""
154
153
for binsha , mode , name in iterable :
155
- path = join (self .path , name )
154
+ path = join_path (self .path , name )
156
155
try :
157
156
yield self ._map_id_to_type [mode >> 12 ](self .repo , binsha , mode , path )
158
157
except KeyError :
@@ -186,7 +185,7 @@ def __div__(self, file):
186
185
else :
187
186
for info in self ._cache :
188
187
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 ]))
190
189
# END for each obj
191
190
raise KeyError ( msg % file )
192
191
# END handle long paths
@@ -231,7 +230,7 @@ def __len__(self):
231
230
def __getitem__ (self , item ):
232
231
if isinstance (item , int ):
233
232
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 ]))
235
234
236
235
if isinstance (item , basestring ):
237
236
# compatability
@@ -254,7 +253,7 @@ def __contains__(self, item):
254
253
# treat item as repo-relative path
255
254
path = self .path
256
255
for info in self ._cache :
257
- if item == join (path , info [2 ]):
256
+ if item == join_path (path , info [2 ]):
258
257
return True
259
258
# END for each item
260
259
return False
0 commit comments