diff options
author | Vanya Sergeev <vsergeev@gmail.com> | 2013-10-11 19:27:21 +0200 |
---|---|---|
committer | Alberto Bertogli <albertito@blitiri.com.ar> | 2013-10-12 02:19:57 +0200 |
commit | d3bf98ea006f9949b16ad10f7d2c88d6809b8619 (patch) | |
tree | 3187a62ba1787703de81688b2d9a5867258f5b73 | |
parent | 6f5f3c4aa5b8e4bc8925aa28fff8bd0ebddc0156 (diff) | |
download | git-arr-fork-d3bf98ea006f9949b16ad10f7d2c88d6809b8619.zip |
Fix parsing of empty commit messages
-rw-r--r-- | git.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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) |