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

Commit5aa8c34

Browse files
committed
Improve type of repo.blame_incremental()
1 parentecb1f79 commit5aa8c34

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

‎git/repo/base.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -811,24 +811,24 @@ def blame_incremental(self, rev: str | HEAD, file: str, **kwargs: Any) -> Iterat
811811
should get a continuous range spanning all line numbers in the file.
812812
"""
813813

814-
data=self.git.blame(rev,'--',file,p=True,incremental=True,stdout_as_string=False,**kwargs)
815-
commits:Dict[str,Commit]= {}
814+
data:bytes=self.git.blame(rev,'--',file,p=True,incremental=True,stdout_as_string=False,**kwargs)
815+
commits:Dict[bytes,Commit]= {}
816816

817817
stream= (lineforlineindata.split(b'\n')ifline)
818818
whileTrue:
819819
try:
820820
line=next(stream)# when exhausted, causes a StopIteration, terminating this function
821821
exceptStopIteration:
822822
return
823-
split_line:Tuple[str,str,str,str]=line.split()
824-
hexsha,orig_lineno_str,lineno_str,num_lines_str=split_line
825-
lineno=int(lineno_str)
826-
num_lines=int(num_lines_str)
827-
orig_lineno=int(orig_lineno_str)
823+
split_line=line.split()
824+
hexsha,orig_lineno_b,lineno_b,num_lines_b=split_line
825+
lineno=int(lineno_b)
826+
num_lines=int(num_lines_b)
827+
orig_lineno=int(orig_lineno_b)
828828
ifhexshanotincommits:
829829
# Now read the next few lines and build up a dict of properties
830830
# for this commit
831-
props= {}
831+
props:Dict[bytes,bytes]= {}
832832
whileTrue:
833833
try:
834834
line=next(stream)
@@ -1126,7 +1126,7 @@ def clone(self, path: PathLike, progress: Optional[Callable] = None,
11261126

11271127
@classmethod
11281128
defclone_from(cls,url:PathLike,to_path:PathLike,progress:Optional[Callable]=None,
1129-
env:Optional[Mapping[str,Any]]=None,
1129+
env:Optional[Mapping[str,str]]=None,
11301130
multi_options:Optional[List[str]]=None,**kwargs:Any)->'Repo':
11311131
"""Create a clone from the given URL
11321132

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp