Update banned word regex matcher

The change updates git_cl to check for "banned words" too in the stdout to add helpful feedback when the upload fails due to banned words.

Bug: 1375130
Change-Id: Ic29faae9d9601face8455ffbb7314955261ffd57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3961632
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
changes/32/3961632/3
Aravind Vasudevan 3 years ago committed by LUCI CQ
parent 77e64ae61e
commit c950858a72

@ -2344,7 +2344,7 @@ class Changelist(object):
push_stdout = push_stdout.decode('utf-8', 'replace')
except subprocess2.CalledProcessError as e:
push_returncode = e.returncode
if 'blocked keyword' in str(e.stdout):
if 'blocked keyword' in str(e.stdout) or 'banned word' in str(e.stdout):
raise GitPushError(
'Failed to create a change, very likely due to blocked keyword. '
'Please examine output above for the reason of the failure.\n'

Loading…
Cancel
Save