From 264ba6f54f928da31a037966198a0849325b3732 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 24 Nov 2010 17:12:36 +0100 Subject: Fixed remaining issues, all tests work as expected --- objects/base.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'objects/base.py') 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 -- cgit v1.2.3