diff --git a/tools_webrtc/autoroller/roll_deps.py b/tools_webrtc/autoroller/roll_deps.py index 1d07ed7947..224f5842e6 100755 --- a/tools_webrtc/autoroller/roll_deps.py +++ b/tools_webrtc/autoroller/roll_deps.py @@ -524,12 +524,8 @@ def GenerateCommitMessage( else: commit_msg.append('No update to Clang.\n') - # TBR needs to be non-empty for Gerrit to process it. - git_author = _RunCommand(['git', 'config', 'user.email'], - working_dir=CHECKOUT_SRC_DIR)[0].splitlines()[0] - tbr_authors = git_author + ',' + tbr_authors - - commit_msg.append('TBR=%s' % tbr_authors) + if tbr_authors: + commit_msg.append('TBR=%s' % tbr_authors) commit_msg.append('BUG=None') return '\n'.join(commit_msg) diff --git a/tools_webrtc/autoroller/unittests/roll_deps_test.py b/tools_webrtc/autoroller/unittests/roll_deps_test.py index 87863bb04f..81620121e2 100755 --- a/tools_webrtc/autoroller/unittests/roll_deps_test.py +++ b/tools_webrtc/autoroller/unittests/roll_deps_test.py @@ -280,16 +280,10 @@ class TestRollChromiumRevision(unittest.TestCase): current_commit_pos = 'cafe' new_commit_pos = 'f00d' - with mock.patch('roll_deps._RunCommand', self.fake): - # We don't really care, but it's needed to construct the message. - self.fake.AddExpectation(['git', 'config', 'user.email'], - _returns=('nobody@nowhere.no', None), - _ignores=['working_dir']) - - commit_msg = GenerateCommitMessage(NO_CHROMIUM_REVISION_UPDATE, - current_commit_pos, - new_commit_pos, changed_deps, - added_paths, removed_paths) + commit_msg = GenerateCommitMessage(NO_CHROMIUM_REVISION_UPDATE, + current_commit_pos, + new_commit_pos, changed_deps, + added_paths, removed_paths) return [l.strip() for l in commit_msg.split('\n')]