aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanya Sergeev <vsergeev@gmail.com>2013-10-11 19:27:21 +0200
committerAlberto Bertogli <albertito@blitiri.com.ar>2013-10-12 02:19:57 +0200
commitd3bf98ea006f9949b16ad10f7d2c88d6809b8619 (patch)
tree3187a62ba1787703de81688b2d9a5867258f5b73
parent6f5f3c4aa5b8e4bc8925aa28fff8bd0ebddc0156 (diff)
downloadgit-arr-fork-d3bf98ea006f9949b16ad10f7d2c88d6809b8619.zip
Fix parsing of empty commit messages
-rw-r--r--git.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/git.py b/git.py
index d005b13..f0e73ba 100644
--- a/git.py
+++ b/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)