summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-07-25 23:41:15 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-07-27 10:04:49 -0400
commitc42498c7247a23cf51ef9f5fd652b1e582bc4fc9 (patch)
tree7f216c6b82e22cae8677d33bd7b48a357ec1853c
parentd7d31462b106f32c54d9444d2ad6ee8e05932dfe (diff)
downloadb4-c42498c7247a23cf51ef9f5fd652b1e582bc4fc9.tar.gz
Fix handling of single-paragraph commit message bodies
The get_body_parts() method added in ba6c790 (Parse body parts into usual chunks, 2020-04-27) strips lines that look like trailers from the last paragraph, storing the other lines to add back to the message. However, if the commit message has only a single paragraph, get_body_parts() returns early, unconditionally returning an empty string for the message even if non-trailer lines were encountered. Return the collected non-trailer lines, if any, as the message. Signed-off-by: Kyle Meyer <kyle@kyleam.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index 68856dd..56dd751 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -1241,6 +1241,8 @@ class LoreMessage:
if githeaders == trailers:
# This is a message that consists of just trailers?
githeaders = list()
+ if nlines:
+ message = '\n'.join(nlines)
return githeaders, message, trailers, basement, signature
# Add all parts between first and last to mparts