summaryrefslogtreecommitdiff
path: root/tools/patman/patchstream.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-08-28 09:43:35 -0600
committerSimon Glass <sjg@chromium.org>2014-09-05 13:40:41 -0600
commite752edcb6b22b2c42c8064d66a93f0910cac6fef (patch)
tree13a11ab0b2beb9930a917ba6e04b09b8d53bdbf5 /tools/patman/patchstream.py
parent6ba5737ff06f09ad980cb1feee059c12bf89a7ff (diff)
patman: Correct unit tests to run correctly
It seems that doctest behaves differently now, and some of the unit tests do not run. Adjust the tests to work correctly. ./tools/patman/patman --test <unittest.result.TestResult run=10 errors=0 failures=0> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/patchstream.py')
-rw-r--r--tools/patman/patchstream.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 00404681c4..322374c570 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -275,7 +275,7 @@ class PatchStream:
# Suppress duplicate signoffs
elif signoff_match:
- if (self.is_log or
+ if (self.is_log or not self.commit or
self.commit.CheckDuplicateSignoff(signoff_match.group(1))):
out = [line]
@@ -312,7 +312,10 @@ class PatchStream:
out = []
log = self.series.MakeChangeLog(self.commit)
out += self.FormatTags(self.tags)
- out += [line] + self.commit.notes + [''] + log
+ out += [line]
+ if self.commit:
+ out += self.commit.notes
+ out += [''] + log
elif self.found_test:
if not re_allowed_after_test.match(line):
self.lines_after_test += 1