41
41
from gitdb .base import IStream
42
42
from gitdb .db import MemoryDB
43
43
44
- import git .diff as diff
44
+ import git .diff as git_diff
45
45
import os .path as osp
46
46
47
47
from .fun import (
88
88
__all__ = ('IndexFile' , 'CheckoutError' )
89
89
90
90
91
- class IndexFile (LazyMixin , diff .Diffable , Serializable ):
91
+ class IndexFile (LazyMixin , git_diff .Diffable , Serializable ):
92
92
93
93
"""
94
94
Implements an Index that can be manipulated using a native implementation in
@@ -575,8 +575,8 @@ def write_tree(self) -> Tree:
575
575
root_tree ._cache = tree_items # type: ignore
576
576
return root_tree
577
577
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 ]]:
580
580
try :
581
581
args .pop (args .index (self ))
582
582
except IndexError :
@@ -1272,10 +1272,11 @@ def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree:
1272
1272
return self
1273
1273
1274
1274
@ 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 ,
1276
1277
paths : Union [str , List [PathLike ], Tuple [PathLike , ...], None ] = None ,
1277
1278
create_patch : bool = False , ** kwargs : Any
1278
- ) -> diff .DiffIndex :
1279
+ ) -> git_diff .DiffIndex :
1279
1280
"""Diff this index against the working copy or a Tree or Commit object
1280
1281
1281
1282
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
1287
1288
"""
1288
1289
# index against index is always empty
1289
1290
if other is self .Index :
1290
- return diff .DiffIndex ()
1291
+ return git_diff .DiffIndex ()
1291
1292
1292
1293
# index against anything but None is a reverse diff with the respective
1293
1294
# item. Handle existing -R flags properly. Transform strings to the object
0 commit comments