提交 4b89b813 编写于 作者: S Scott Wood 提交者: Simon Glass

patman: Check commit_match before stripping leading whitespace

True commit lines start at column zero.  Anything that is indented
is part of the commit message instead.  I noticed this by trying to
run buildman with commit e3a4facd
as master, which contained a reference to a Linux commit inside
the commit message.  ProcessLine saw that as a genuite commit
line, and thus buildman tried to build it, and died with an
exception because that SHA is not present in the U-Boot tree.
Signed-off-by: NScott Wood <scottwood@freescale.com>
Acked-by: NSimon Glass <sjg@chromium.org>
上级 2181830f
......@@ -139,6 +139,9 @@ class PatchStream:
# Initially we have no output. Prepare the input line string
out = []
line = line.rstrip('\n')
commit_match = re_commit.match(line) if self.is_log else None
if self.is_log:
if line[:4] == ' ':
line = line[4:]
......@@ -146,7 +149,6 @@ class PatchStream:
# Handle state transition and skipping blank lines
series_tag_match = re_series_tag.match(line)
commit_tag_match = re_commit_tag.match(line)
commit_match = re_commit.match(line) if self.is_log else None
cover_cc_match = re_cover_cc.match(line)
signoff_match = re_signoff.match(line)
tag_match = None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册