| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,8 @@ | |||
| 10 | 10 | from .objects.blob import Blob | |
| 11 | 11 | from .objects.util import mode_str_to_int | |
| 12 | 12 | ||
| 13 | + from git.compat import defenc | ||
| 14 | + | ||
| 13 | 15 | ||
| 14 | 16 | __all__ = ('Diffable', 'DiffIndex', 'Diff') | |
| 15 | 17 | ||
@@ -294,7 +296,7 @@ def _index_from_patch_format(cls, repo, stream): | |||
| 294 | 296 | :param stream: result of 'git diff' as a stream (supporting file protocol) | |
| 295 | 297 | :return: git.DiffIndex """ | |
| 296 | 298 | # for now, we have to bake the stream | |
| 297 | - text = stream.read() | ||
| 299 | + text = stream.read().decode(defenc) | ||
| 298 | 300 | index = DiffIndex() | |
| 299 | 301 | ||
| 300 | 302 | diff_header = cls.re_header.match | |
@@ -323,6 +325,7 @@ def _index_from_raw_format(cls, repo, stream): | |||
| 323 | 325 | # :100644 100644 687099101... 37c5e30c8... M .gitignore | |
| 324 | 326 | index = DiffIndex() | |
| 325 | 327 | for line in stream: | |
| 328 | + line = line.decode(defenc) | ||
| 326 | 329 | if not line.startswith(":"): | |
| 327 | 330 | continue | |
| 328 | 331 | # END its not a valid diff line | |
| Back | FazBrowse Home | New Git URL |
0 commit comments