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

Commite4761ff

Browse files
committed
Test TypedDict in repo.base.blame() 1
1 parented137cb commite4761ff

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

‎git/repo/base.py‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ class InfoTD(TypedDict, total=False):
909909
line_str=line_bytes.rstrip().decode(defenc)
910910
exceptUnicodeDecodeError:
911911
firstpart=''
912-
parts= ['']
912+
parts= []
913913
is_binary=True
914914
else:
915915
# As we don't have an idea when the binary data ends, as it could contain multiple newlines
@@ -983,20 +983,21 @@ class InfoTD(TypedDict, total=False):
983983
info['committer']+' '+info['committer_email']),
984984
committed_date=info['committer_date'])
985985
commits[sha]=c
986-
blames[-1][0]=c
986+
blames[-1][0]=c
987987
# END if commit objects needs initial creation
988+
ifnotis_binary:
989+
ifline_strandline_str[0]=='\t':
990+
line_str=line_str[1:]
991+
else:
992+
pass
993+
# NOTE: We are actually parsing lines out of binary data, which can lead to the
994+
# binary being split up along the newline separator. We will append this to the
995+
# blame we are currently looking at, even though it should be concatenated with
996+
# the last line we have seen.
997+
988998
ifblames[-1][1]isnotNone:
989-
ifnotis_binary:
990-
ifline_strandline_str[0]=='\t':
991-
line_str=line_str[1:]
992-
993-
blames[-1][1].append(line_str)
994-
else:
995-
# NOTE: We are actually parsing lines out of binary data, which can lead to the
996-
# binary being split up along the newline separator. We will append this to the
997-
# blame we are currently looking at, even though it should be concatenated with
998-
# the last line we have seen.
999-
blames[-1][1].append(line_bytes)
999+
blames[-1][1].append(line_str)
1000+
info= {'id':sha}
10001001
# end handle line contents
10011002

10021003
info= {'id':sha}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp