Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb03af05

Browse files
committed
Remove defsult_index decorator from diff() and do check within function. Breaks typechecking for some reason
1 parent9bb630f commitb03af05

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎git/index/base.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,10 @@ def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree:
12711271

12721272
returnself
12731273

1274-
@default_index
1274+
#@ default_index, breaks typing for some reason, copied into function
12751275
defdiff(self,
12761276
other:Union[git_diff.Diffable.Index,'IndexFile.Index',Treeish,None,object]=git_diff.Diffable.Index,
1277-
paths:Union[str,List[PathLike],Tuple[PathLike, ...],None]=None,
1277+
paths:Union[PathLike,List[PathLike],Tuple[PathLike, ...],None]=None,
12781278
create_patch:bool=False,**kwargs:Any
12791279
)->git_diff.DiffIndex:
12801280
"""Diff this index against the working copy or a Tree or Commit object
@@ -1286,6 +1286,11 @@ def diff(self,
12861286
Will only work with indices that represent the default git index as
12871287
they have not been initialized with a stream.
12881288
"""
1289+
1290+
# only run if we are the default repository index
1291+
ifself._file_path!=self._index_path():
1292+
raiseAssertionError(
1293+
"Cannot call %r on indices that do not represent the default git index"%self.diff())
12891294
# index against index is always empty
12901295
ifotherisself.Index:
12911296
returngit_diff.DiffIndex()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp