1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

patman: Avoid blank lines between tags

In some cases 'patman status' leaves a blank line between the sign-off
and the tags it collects from patchwork. Fix this and add a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2021-08-01 16:02:39 -06:00
parent 1e9ced28f1
commit 5974718752
2 changed files with 28 additions and 2 deletions

View File

@@ -662,6 +662,7 @@ def insert_tags(msg, tags_to_emit):
out = []
done = False
emit_tags = False
emit_blank = False
for line in msg.splitlines():
if not done:
signoff_match = RE_SIGNOFF.match(line)
@@ -672,9 +673,13 @@ def insert_tags(msg, tags_to_emit):
out += tags_to_emit
emit_tags = False
done = True
emit_blank = not (signoff_match or tag_match)
else:
emit_blank = line
out.append(line)
if not done:
out.append('')
if emit_blank:
out.append('')
out += tags_to_emit
return '\n'.join(out)