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

Commit09053c5

Browse files
committed
Improve IndexFile_process_diff_args() to get checks to rerun
1 parent797e962 commit09053c5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎git/diff.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,16 @@ class Diffable(object):
8282
classIndex(object):
8383
pass
8484

85-
def_process_diff_args(self,args:List[Union[PathLike,'Diffable',Type['Diffable.Index']]]
86-
)->List[Union[PathLike,'Diffable',Type['Diffable.Index']]]:
85+
def_process_diff_args(self,args:List[Union[str,'Diffable',Type['Diffable.Index'],object]]
86+
)->List[Union[str,'Diffable',Type['Diffable.Index'],object]]:
8787
"""
8888
:return:
8989
possibly altered version of the given args list.
9090
Method is called right before git command execution.
9191
Subclasses can use it to alter the behaviour of the superclass"""
9292
returnargs
9393

94-
defdiff(self,other:Union[Type['Index'],'Tree','Commit',None,str]=Index,# object for git.NULL_TREE
94+
defdiff(self,other:Union[Type['Index'],'Tree','Commit',None,str,object]=Index,
9595
paths:Union[PathLike,List[PathLike],Tuple[PathLike, ...],None]=None,
9696
create_patch:bool=False,**kwargs:Any)->'DiffIndex':
9797
"""Creates diffs between two items being trees, trees and index or an
@@ -124,7 +124,7 @@ def diff(self, other: Union[Type['Index'], 'Tree', 'Commit', None, str] = Index,
124124
:note:
125125
On a bare repository, 'other' needs to be provided as Index or as
126126
as Tree/Commit, or a git command error will occur"""
127-
args:List[Union[PathLike,Diffable,Type['Diffable.Index']]]= []
127+
args:List[Union[PathLike,Diffable,Type['Diffable.Index'],object]]= []
128128
args.append("--abbrev=40")# we need full shas
129129
args.append("--full-index")# get full index paths, not only filenames
130130

‎git/index/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,9 @@ def write_tree(self) -> Tree:
575575
root_tree._cache=tree_items# type: ignore
576576
returnroot_tree
577577

578-
def_process_diff_args(self,args:List[Union[PathLike,'git_diff.Diffable',Type['git_diff.Diffable.Index']]]
579-
)->List[Union[PathLike,'git_diff.Diffable',Type['git_diff.Diffable.Index']]]:
578+
def_process_diff_args(self,# type: ignore[override]
579+
args:List[Union[str,'git_diff.Diffable',Type['git_diff.Diffable.Index']]]
580+
)->List[Union[str,'git_diff.Diffable',Type['git_diff.Diffable.Index']]]:
580581
try:
581582
args.pop(args.index(self))
582583
exceptIndexError:
@@ -1272,9 +1273,8 @@ def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree:
12721273
returnself
12731274

12741275
# @ default_index, breaks typing for some reason, copied into function
1275-
defdiff(self,
1276-
other:Union[Type['git_diff.Diffable.Index'],'IndexFile.Index',
1277-
'Tree','Commit',str,None]=git_diff.Diffable.Index,
1276+
defdiff(self,# type: ignore[override]
1277+
other:Union[Type['git_diff.Diffable.Index'],'Tree','Commit',str,None]=git_diff.Diffable.Index,
12781278
paths:Union[PathLike,List[PathLike],Tuple[PathLike, ...],None]=None,
12791279
create_patch:bool=False,**kwargs:Any
12801280
)->git_diff.DiffIndex:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp