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

Commit31b3673

Browse files
committed
test_diff works
1 parente1060a2 commit31b3673

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎git/diff.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from .objects.blobimportBlob
1111
from .objects.utilimportmode_str_to_int
1212

13+
fromgit.compatimportdefenc
14+
1315

1416
__all__= ('Diffable','DiffIndex','Diff')
1517

@@ -294,7 +296,7 @@ def _index_from_patch_format(cls, repo, stream):
294296
:param stream: result of 'git diff' as a stream (supporting file protocol)
295297
:return: git.DiffIndex """
296298
# for now, we have to bake the stream
297-
text=stream.read()
299+
text=stream.read().decode(defenc)
298300
index=DiffIndex()
299301

300302
diff_header=cls.re_header.match
@@ -323,6 +325,7 @@ def _index_from_raw_format(cls, repo, stream):
323325
# :100644 100644 687099101... 37c5e30c8... M .gitignore
324326
index=DiffIndex()
325327
forlineinstream:
328+
line=line.decode(defenc)
326329
ifnotline.startswith(":"):
327330
continue
328331
# END its not a valid diff line

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp