Fix tests.
authorJelmer Vernooij <jelmer@jelmer.uk>
Wed, 2 Dec 2015 19:51:50 +0000 (19:51 +0000)
committerJelmer Vernooij <jelmer@jelmer.uk>
Wed, 2 Dec 2015 19:51:50 +0000 (19:51 +0000)
dulwich/reflog.py

index 083770aa29f71fece81e881db58cd1594f536385..4507f4274f9706b43387587179e0cbcd2fa729c6 100644 (file)
@@ -45,7 +45,7 @@ def format_reflog_line(old_sha, new_sha, committer, timestamp, timezone, message
         old_sha = ZERO_SHA
     return (old_sha + b' ' + new_sha + b' ' + committer + b' ' +
             str(timestamp).encode('ascii') + b' ' +
-            format_timezone(timezone).encode('ascii') + b'\t' + message)
+            format_timezone(timezone) + b'\t' + message)
 
 
 def parse_reflog_line(line):
@@ -55,9 +55,9 @@ def parse_reflog_line(line):
     :return: Tuple of (old_sha, new_sha, committer, timestamp, timezone,
         message)
     """
-    (begin, message) = line.split('\t', 1)
-    (old_sha, new_sha, rest) = begin.split(' ', 2)
-    (committer, timestamp_str, timezone_str) = rest.rsplit(' ', 2)
+    (begin, message) = line.split(b'\t', 1)
+    (old_sha, new_sha, rest) = begin.split(b' ', 2)
+    (committer, timestamp_str, timezone_str) = rest.rsplit(b' ', 2)
     return Entry(old_sha, new_sha, committer, int(timestamp_str),
                  parse_timezone(timezone_str)[0], message)