From 31b3673bdb9d8fb7feea8ae887be455c4a880f76 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 5 Jan 2015 18:03:08 +0100 Subject: test_diff works --- git/diff.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'git/diff.py') 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 -- cgit v1.2.1