File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -940,7 +940,7 @@ def _items_to_rela_paths(
940940        for  item  in  items :
941941            if  isinstance (item , (BaseIndexEntry , (Blob , Submodule ))):
942942                paths .append (self ._to_relative_path (item .path ))
943-             elif  isinstance (item , str ):
943+             elif  isinstance (item , ( str ,  os . PathLike ) ):
944944                paths .append (self ._to_relative_path (item ))
945945            else :
946946                raise  TypeError ("Invalid item type: %r"  %  item )
Original file line number Diff line number Diff line change @@ -558,14 +558,16 @@ def test_index_mutation(self, rw_repo):
558558        def  mixed_iterator ():
559559            count  =  0 
560560            for  entry  in  index .entries .values ():
561-                 type_id  =  count  %  4 
562-                 if  type_id  ==  0 :  # path 
561+                 type_id  =  count  %  5 
562+                 if  type_id  ==  0 :  # path (str)  
563563                    yield  entry .path 
564-                 elif  type_id  ==  1 :  # blob 
564+                 elif  type_id  ==  1 :  # path (PathLike) 
565+                     yield  Path (entry .path )
566+                 elif  type_id  ==  2 :  # blob 
565567                    yield  Blob (rw_repo , entry .binsha , entry .mode , entry .path )
566-                 elif  type_id  ==  2 :  # BaseIndexEntry 
568+                 elif  type_id  ==  3 :  # BaseIndexEntry 
567569                    yield  BaseIndexEntry (entry [:4 ])
568-                 elif  type_id  ==  3 :  # IndexEntry 
570+                 elif  type_id  ==  4 :  # IndexEntry 
569571                    yield  entry 
570572                else :
571573                    raise  AssertionError ("Invalid Type" )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments