@@ -113,7 +113,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
113
113
_VERSION = 2 # latest version we support
114
114
S_IFGITLINK = S_IFGITLINK # a submodule
115
115
116
- def __init__ (self , repo : 'Repo' , file_path : PathLike = None ) -> None :
116
+ def __init__ (self , repo : 'Repo' , file_path : Union [ PathLike , None ] = None ) -> None :
117
117
"""Initialize this Index instance, optionally from the given ``file_path``.
118
118
If no file_path is given, we will be created from the current index file.
119
119
@@ -665,7 +665,7 @@ def _entries_for_paths(self, paths: List[str], path_rewriter: Callable, fprogres
665
665
return entries_added
666
666
667
667
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 ,
669
669
write : bool = True , write_extension_data : bool = False ) -> List [BaseIndexEntry ]:
670
670
"""Add files from the working tree, specific blobs or BaseIndexEntries
671
671
to the index.
@@ -970,7 +970,8 @@ def move(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, 'Submodule'
970
970
return out
971
971
972
972
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 ,
974
975
skip_hooks : bool = False ) -> Commit :
975
976
"""Commit the current default index file, creating a commit object.
976
977
For more information on the arguments, see tree.commit.
@@ -1265,7 +1266,8 @@ def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree:
1265
1266
1266
1267
@ default_index
1267
1268
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
1269
1271
) -> diff .DiffIndex :
1270
1272
"""Diff this index against the working copy or a Tree or Commit object
1271
1273
0 commit comments