Skip to content

Commit

Permalink
Merge pull request #47 from ssc-oscar/fix/empty-commit
Browse files Browse the repository at this point in the history
Fail gracefully if some commit in a project is empty
  • Loading branch information
audrism authored Jun 30, 2021
2 parents 5b8c632 + 34649c4 commit 1f5a327
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion oscar.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f5a327

Please sign in to comment.