diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-06-08 11:53:30 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-06-08 12:30:02 -0400 |
commit | c15b77e0eb0a7939aea61019aa066d0ce97c66ec (patch) | |
tree | 49093349f958159ed8d1bb6c49744aaac673a8e3 | |
parent | 92be4a8e4a5f1c57fc7ebd1378d1870e7af68435 (diff) | |
download | b4-c15b77e0eb0a7939aea61019aa066d0ce97c66ec.tar.gz |
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 <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index a515ac6..fe0a8a1 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') |