Fix parsing of empty commit messages
This commit is contained in:
parent
6f5f3c4aa5
commit
d3bf98ea00
7
git.py
7
git.py
@ -397,7 +397,12 @@ class Commit (object):
|
||||
@staticmethod
|
||||
def from_str(repo, buf):
|
||||
"""Parses git rev-list output, returns a commit object."""
|
||||
header, raw_message = buf.split('\n\n', 1)
|
||||
if '\n\n' in buf:
|
||||
# Header, commit message
|
||||
header, raw_message = buf.split('\n\n', 1)
|
||||
else:
|
||||
# Header only, no commit message
|
||||
header, raw_message = buf.rstrip(), ' '
|
||||
|
||||
header_lines = header.split('\n')
|
||||
commit_id = header_lines.pop(0)
|
||||
|
Loading…
Reference in New Issue
Block a user