@@ -404,7 +404,7 @@ def _iter_expand_paths(self: "IndexFile", paths: Sequence[PathLike]) -> Iterator
404404 def raise_exc (e : Exception ) -> NoReturn :
405405 raise e
406406
407- r = os . fspath (self .repo .working_tree_dir )
407+ r = str (self .repo .working_tree_dir )
408408 rs = r + os .sep
409409 for path in paths :
410410 abs_path = os .fspath (path )
@@ -656,7 +656,7 @@ def _to_relative_path(self, path: PathLike) -> PathLike:
656656 return path
657657 if self .repo .bare :
658658 raise InvalidGitRepositoryError ("require non-bare repository" )
659- if not osp .normpath (path ).startswith (os . fspath (self .repo .working_tree_dir )):
659+ if not osp .normpath (path ).startswith (str (self .repo .working_tree_dir )):
660660 raise ValueError ("Absolute path %r is not in git repository at %r" % (path , self .repo .working_tree_dir ))
661661 result = os .path .relpath (path , self .repo .working_tree_dir )
662662 if os .fspath (path ).endswith (os .sep ) and not result .endswith (os .sep ):
@@ -731,7 +731,7 @@ def _entries_for_paths(
731731 for path in paths :
732732 if osp .isabs (path ):
733733 abspath = path
734- gitrelative_path = path [len (os . fspath (self .repo .working_tree_dir )) + 1 :]
734+ gitrelative_path = path [len (str (self .repo .working_tree_dir )) + 1 :]
735735 else :
736736 gitrelative_path = path
737737 if self .repo .working_tree_dir :
@@ -1036,7 +1036,7 @@ def remove(
10361036 args .append ("--" )
10371037
10381038 # Preprocess paths.
1039- paths = self ._items_to_rela_paths (items )
1039+ paths = list ( map ( os . fspath , self ._items_to_rela_paths (items ))) # type: ignore[arg-type]
10401040 removed_paths = self .repo .git .rm (args , paths , ** kwargs ).splitlines ()
10411041
10421042 # Process output to gain proper paths.
@@ -1363,7 +1363,7 @@ def make_exc() -> GitCommandError:
13631363 if not folder .endswith ("/" ):
13641364 folder += "/"
13651365 for entry in self .entries .values ():
1366- if entry .path .startswith (folder ):
1366+ if os . fspath ( entry .path ) .startswith (folder ):
13671367 p = entry .path
13681368 self ._write_path_to_stdin (proc , p , p , make_exc , fprogress , read_from_stdout = False )
13691369 checked_out_files .append (p )
0 commit comments