Gerrit git cl: fix change-id appending.

Special case when the change description has no footers, but looks
like a footer.

R=machenbach@chromium.org,andybons@chromium.org
BUG=579176

Review URL: https://codereview.chromium.org/1812803002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299343 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
tandrii@chromium.org
2016-03-17 12:38:55 +00:00
parent 29c3b34610
commit 9fc50db2cc
2 changed files with 10 additions and 1 deletions

View File

@@ -83,9 +83,13 @@ def add_footer_change_id(message, change_id):
if line == '' or line.isspace():
break
footer_lines.append(line)
else:
# The whole description was consisting of footers,
# which means those aren't footers.
footer_lines = []
# footers order is from end to start of the message.
footers = map(parse_footer, footer_lines)
if not all(footers):
if not footers or not all(footers):
lines.append('')
lines.append(change_id_line)
else: