4141from gitdb .base import IStream
4242from gitdb .db import MemoryDB
4343
44- import git .diff as diff
44+ import git .diff as git_diff
4545import os .path as osp
4646
4747from .fun import (
8888__all__ = ('IndexFile' , 'CheckoutError' )
8989
9090
91- class IndexFile (LazyMixin , diff .Diffable , Serializable ):
91+ class IndexFile (LazyMixin , git_diff .Diffable , Serializable ):
9292
9393 """
9494 Implements an Index that can be manipulated using a native implementation in
@@ -575,8 +575,8 @@ def write_tree(self) -> Tree:
575575 root_tree ._cache = tree_items # type: ignore
576576 return root_tree
577577
578- def _process_diff_args (self , args : List [Union [str , diff .Diffable , object ]]
579- ) -> List [Union [str , diff .Diffable , object ]]:
578+ def _process_diff_args (self , args : List [Union [str , git_diff .Diffable , object ]]
579+ ) -> List [Union [str , git_diff .Diffable , object ]]:
580580 try :
581581 args .pop (args .index (self ))
582582 except IndexError :
@@ -1272,10 +1272,11 @@ def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree:
12721272 return self
12731273
12741274 @ default_index
1275- def diff (self , other : Union [diff .Diffable .Index , 'IndexFile.Index' , Treeish , None , object ] = diff .Diffable .Index ,
1275+ def diff (self ,
1276+ other : Union [git_diff .Diffable .Index , 'IndexFile.Index' , Treeish , None , object ] = git_diff .Diffable .Index ,
12761277 paths : Union [str , List [PathLike ], Tuple [PathLike , ...], None ] = None ,
12771278 create_patch : bool = False , ** kwargs : Any
1278- ) -> diff .DiffIndex :
1279+ ) -> git_diff .DiffIndex :
12791280 """Diff this index against the working copy or a Tree or Commit object
12801281
12811282 For a documentation of the parameters and return values, see,
@@ -1287,7 +1288,7 @@ def diff(self, other: Union[diff.Diffable.Index, 'IndexFile.Index', Treeish, Non
12871288 """
12881289 # index against index is always empty
12891290 if other is self .Index :
1290- return diff .DiffIndex ()
1291+ return git_diff .DiffIndex ()
12911292
12921293 # index against anything but None is a reverse diff with the respective
12931294 # item. Handle existing -R flags properly. Transform strings to the object
0 commit comments