From 31f33fd215590c40a03961580eb33bb1f9616835 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 8 Jun 2020 11:53:30 -0400 Subject: Fix body part parsing when '---' is not used If the commit message is not separated from the diff using '---' as is commonly the case, fall back to splitting by the word "diff". Reported-by: Mark Brown Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/b4/__init__.py b/b4/__init__.py index b5b4f99..cee14f8 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1199,6 +1199,11 @@ class LoreMessage: parts = body.split('\n---\n', 1) if len(parts) == 2: basement = parts[1].rstrip('\n') + elif body.find('\ndiff ') >= 0: + parts = body.split('\ndiff ', 1) + if len(parts) == 2: + parts[1] = 'diff ' + parts[1] + basement = parts[1].rstrip('\n') mbody = parts[0].strip('\n') -- cgit v1.2.3