diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-11-24 19:48:59 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-11-24 19:48:59 +0100 |
commit | 3175b5b21194bcc8f4448abe0a03a98d3a4a1360 (patch) | |
tree | f1a098c4b38ae3b7cf52600e9fc9c357cdd7c353 /objects/base.py | |
parent | fca367548e365f93c58c47dea45507025269f59a (diff) | |
parent | 3203cd7629345d32806f470a308975076b2b4686 (diff) | |
download | gitpython-3175b5b21194bcc8f4448abe0a03a98d3a4a1360.tar.gz |
Merge branch 'reflog'
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 |