mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Fix git_footers to recognize footers with empty value.
R=agable@chromium.org,iannucci@chromium.org Before, this block of footers won't be recognized by git_footers: Bug: Change-Id: xxx because of empty value for "Bug:". This CL fixes this behavior. Bug: 715614 Change-Id: Iabe45bfc027fda15cbe0cd5ce9b883ce3b891220 Reviewed-on: https://chromium-review.googlesource.com/487963 Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org> Reviewed-by: Robbie Iannucci <iannucci@chromium.org> Reviewed-by: Aaron Gable <agable@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
1c33e44925
commit
80cae42d7f
@@ -13,7 +13,7 @@ from collections import defaultdict
|
||||
import git_common as git
|
||||
|
||||
|
||||
FOOTER_PATTERN = re.compile(r'^\s*([\w-]+): (.*)$')
|
||||
FOOTER_PATTERN = re.compile(r'^\s*([\w-]+): *(.*)$')
|
||||
CHROME_COMMIT_POSITION_PATTERN = re.compile(r'^([\w/\-\.]+)@{#(\d+)}$')
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,13 @@ My commit message is my best friend. It is my life. I must master it.
|
||||
self.assertEqual(
|
||||
git_footers.split_footers('\nActual: footer'),
|
||||
([''], ['Actual: footer'], [('Actual', 'footer')]))
|
||||
self.assertEqual(
|
||||
git_footers.split_footers('H\n\nBug:\nAlso: footer'),
|
||||
(['H', ''], ['Bug:', 'Also: footer'],
|
||||
[('Bug', ''), ('Also', 'footer')]))
|
||||
self.assertEqual(
|
||||
git_footers.split_footers('H\n\nBug: '),
|
||||
(['H', ''], ['Bug: '], [('Bug', '')]))
|
||||
|
||||
self.assertEqual(
|
||||
git_footers.parse_footers(self._message), {})
|
||||
@@ -45,6 +52,13 @@ My commit message is my best friend. It is my life. I must master it.
|
||||
git_footers.parse_footers(self._message + self._position_footer
|
||||
+ self._position_footer),
|
||||
{ 'Cr-Commit-Position': [ self._position, self._position ] })
|
||||
self.assertEqual(
|
||||
git_footers.parse_footers(self._message +
|
||||
'Bug:\n' +
|
||||
self._position_footer),
|
||||
{ 'Bug': [''],
|
||||
'Cr-Commit-Position': [ self._position ] })
|
||||
|
||||
|
||||
def testGetFooterChangeId(self):
|
||||
msg = '\n'.join(['whatever',
|
||||
|
||||
Reference in New Issue
Block a user