summaryrefslogtreecommitdiff
path: root/git/objects/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-05 17:59:22 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-05 17:59:22 +0100
commite1060a2a8c90c0730c3541811df8f906dac510a7 (patch)
tree1c29ef00a756be7e88aeb43cfa847dbf2e6f3079 /git/objects/base.py
parent8a308613467a1510f8dac514624abae4e10c0779 (diff)
downloadgitpython-e1060a2a8c90c0730c3541811df8f906dac510a7.tar.gz
test_commit works once again
Diffstat (limited to 'git/objects/base.py')
-rw-r--r--git/objects/base.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/git/objects/base.py b/git/objects/base.py
index 1f0d5752..004e3981 100644
--- a/git/objects/base.py
+++ b/git/objects/base.py
@@ -21,7 +21,7 @@ class Object(LazyMixin):
"""Implements an Object which may be Blobs, Trees, Commits and Tags"""
NULL_HEX_SHA = '0' * 40
- NULL_BIN_SHA = '\0' * 20
+ NULL_BIN_SHA = b'\0' * 20
TYPES = (dbtyp.str_blob_type, dbtyp.str_tree_type, dbtyp.str_commit_type, dbtyp.str_tag_type)
__slots__ = ("repo", "binsha", "size")
@@ -94,7 +94,7 @@ class Object(LazyMixin):
def __str__(self):
""":return: string of our SHA1 as understood by all git commands"""
- return bin_to_hex(self.binsha)
+ return self.hexsha
def __repr__(self):
""":return: string with pythonic representation of our object"""
@@ -103,7 +103,8 @@ class Object(LazyMixin):
@property
def hexsha(self):
""":return: 40 byte hex version of our 20 byte binary sha"""
- return bin_to_hex(self.binsha)
+ # b2a_hex produces bytes
+ return bin_to_hex(self.binsha).decode('ascii')
@property
def data_stream(self):