summaryrefslogtreecommitdiff
path: root/git/objects/fun.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-04 19:50:28 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-04 19:50:28 +0100
commitae2ff0f9d704dc776a1934f72a339da206a9fff4 (patch)
tree53b7cb30f47c60bdf38d824f1c729191d1f1f2d9 /git/objects/fun.py
parentf6aa8d116eb33293c0a9d6d600eb7c32832758b9 (diff)
downloadgitpython-ae2ff0f9d704dc776a1934f72a339da206a9fff4.tar.gz
Dum brute force conversion of all types.
However, StringIO really is ByteIO in most cases, and py2.7 should run but doesn't. This should be made work first.
Diffstat (limited to 'git/objects/fun.py')
-rw-r--r--git/objects/fun.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/git/objects/fun.py b/git/objects/fun.py
index 416a52e6..db2ec7c2 100644
--- a/git/objects/fun.py
+++ b/git/objects/fun.py
@@ -1,5 +1,9 @@
"""Module with functions which are supposed to be as fast as possible"""
from stat import S_ISDIR
+from git.compat import (
+ xrange,
+ text_type
+)
__all__ = ('tree_to_stream', 'tree_entries_from_data', 'traverse_trees_recursive',
'traverse_tree_recursive')
@@ -28,7 +32,7 @@ def tree_to_stream(entries, write):
# hence we must convert to an utf8 string for it to work properly.
# According to my tests, this is exactly what git does, that is it just
# takes the input literally, which appears to be utf8 on linux.
- if isinstance(name, unicode):
+ if isinstance(name, text_type):
name = name.encode("utf8")
write("%s %s\0%s" % (mode_str, name, binsha))
# END for each item