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>
diff --git a/git_cl.py b/git_cl.py
index 869bbe3..b11ac3a 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2344,7 +2344,7 @@
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'