summaryrefslogtreecommitdiff
path: root/git/diff.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-05 18:03:08 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-05 18:03:08 +0100
commit31b3673bdb9d8fb7feea8ae887be455c4a880f76 (patch)
tree29359fbfdd7d73cb4be05e779af1bb7786481a38 /git/diff.py
parente1060a2a8c90c0730c3541811df8f906dac510a7 (diff)
downloadgitpython-31b3673bdb9d8fb7feea8ae887be455c4a880f76.tar.gz
test_diff works
Diffstat (limited to 'git/diff.py')
-rw-r--r--git/diff.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git/diff.py b/git/diff.py
index 1692d83e..3c4e8529 100644
--- a/git/diff.py
+++ b/git/diff.py
@@ -10,6 +10,8 @@ from gitdb.util import hex_to_bin
from .objects.blob import Blob
from .objects.util import mode_str_to_int
+from git.compat import defenc
+
__all__ = ('Diffable', 'DiffIndex', 'Diff')
@@ -294,7 +296,7 @@ class Diff(object):
:param stream: result of 'git diff' as a stream (supporting file protocol)
:return: git.DiffIndex """
# for now, we have to bake the stream
- text = stream.read()
+ text = stream.read().decode(defenc)
index = DiffIndex()
diff_header = cls.re_header.match
@@ -323,6 +325,7 @@ class Diff(object):
# :100644 100644 687099101... 37c5e30c8... M .gitignore
index = DiffIndex()
for line in stream:
+ line = line.decode(defenc)
if not line.startswith(":"):
continue
# END its not a valid diff line