diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-11-24 17:12:36 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-11-24 17:12:36 +0100 |
commit | 264ba6f54f928da31a037966198a0849325b3732 (patch) | |
tree | 3cc84ae352307fd5fded67f6a0c1e4fd376ed843 /objects/base.py | |
parent | ec0657cf5de9aeb5629cc4f4f38b36f48490493e (diff) | |
download | gitpython-264ba6f54f928da31a037966198a0849325b3732.tar.gz |
Fixed remaining issues, all tests work as expected
Diffstat (limited to 'objects/base.py')
-rw-r--r-- | objects/base.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/objects/base.py b/objects/base.py index b8cec47f..5f2f7809 100644 --- a/objects/base.py +++ b/objects/base.py @@ -57,6 +57,10 @@ class Object(LazyMixin): :return: new object instance of a type appropriate to represent the given binary sha1 :param sha1: 20 byte binary sha1""" + if sha1 == cls.NULL_BIN_SHA: + # the NULL binsha is always the root commit + return get_object_type_by_name('commit')(repo, sha1) + #END handle special case oinfo = repo.odb.info(sha1) inst = get_object_type_by_name(oinfo.type)(repo, oinfo.binsha) inst.size = oinfo.size |