@@ -113,7 +113,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
113113 _VERSION = 2 # latest version we support
114114 S_IFGITLINK = S_IFGITLINK # a submodule
115115
116- def __init__ (self , repo : 'Repo' , file_path : PathLike = None ) -> None :
116+ def __init__ (self , repo : 'Repo' , file_path : Union [ PathLike , None ] = None ) -> None :
117117 """Initialize this Index instance, optionally from the given ``file_path``.
118118 If no file_path is given, we will be created from the current index file.
119119
@@ -665,7 +665,7 @@ def _entries_for_paths(self, paths: List[str], path_rewriter: Callable, fprogres
665665 return entries_added
666666
667667 def add (self , items : Sequence [Union [PathLike , Blob , BaseIndexEntry , 'Submodule' ]], force : bool = True ,
668- fprogress : Callable = lambda * args : None , path_rewriter : Callable = None ,
668+ fprogress : Callable = lambda * args : None , path_rewriter : Union [ Callable [..., PathLike ], None ] = None ,
669669 write : bool = True , write_extension_data : bool = False ) -> List [BaseIndexEntry ]:
670670 """Add files from the working tree, specific blobs or BaseIndexEntries
671671 to the index.
@@ -970,7 +970,8 @@ def move(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, 'Submodule'
970970 return out
971971
972972 def commit (self , message : str , parent_commits = None , head : bool = True , author : Union [None , 'Actor' ] = None ,
973- committer : Union [None , 'Actor' ] = None , author_date : str = None , commit_date : str = None ,
973+ committer : Union [None , 'Actor' ] = None , author_date : Union [str , None ] = None ,
974+ commit_date : Union [str , None ] = None ,
974975 skip_hooks : bool = False ) -> Commit :
975976 """Commit the current default index file, creating a commit object.
976977 For more information on the arguments, see tree.commit.
@@ -1265,7 +1266,8 @@ def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree:
12651266
12661267 @ default_index
12671268 def diff (self , other : Union [diff .Diffable .Index , 'IndexFile.Index' , Treeish , None , object ] = diff .Diffable .Index ,
1268- paths : Union [str , List [PathLike ], Tuple [PathLike , ...]] = None , create_patch : bool = False , ** kwargs : Any
1269+ paths : Union [str , List [PathLike ], Tuple [PathLike , ...], None ] = None ,
1270+ create_patch : bool = False , ** kwargs : Any
12691271 ) -> diff .DiffIndex :
12701272 """Diff this index against the working copy or a Tree or Commit object
12711273
0 commit comments