From 34649c4286ee0880d84c71fdb86b76787f11f247 Mon Sep 17 00:00:00 2001 From: Chris Bogart Date: Tue, 29 Jun 2021 18:14:13 -0400 Subject: [PATCH] Fail gracefully if some commit in a project is empty --- oscar.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oscar.pyx b/oscar.pyx index 00d9395..64e2cee 100644 --- a/oscar.pyx +++ b/oscar.pyx @@ -1053,7 +1053,10 @@ class Commit(GitObject): # self.parent_shas = tuple(parent_shas) def _parse(self): - self.header, self.full_message = self.data.split(b'\n\n', 1) + try: + self.header, self.full_message = self.data.split(b'\n\n', 1) + except ValueError: # Sometimes self.data == b'' + raise ObjectNotFound() self.message = self.full_message.split(b'\n', 1)[0] cdef list parent_shas = [] cdef bytes signature = None