Show an error message when the user tries to set the commit flag or add trybots to a private issue.

BUG=387088

Review URL: https://codereview.chromium.org/348933002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@279514 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git_cl.py b/git_cl.py
index 6a43b3d..f86a781 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2267,6 +2267,10 @@
   if not cl.GetIssue():
     parser.error('Need to upload first')
 
+  props = cl.GetIssueProperties()
+  if props.get('private'):
+    parser.error('Cannot use trybots with private issue')
+
   if not options.name:
     options.name = cl.GetBranch()
 
@@ -2412,6 +2416,9 @@
   if args:
     parser.error('Unrecognized args: %s' % ' '.join(args))
   cl = Changelist()
+  props = cl.GetIssueProperties()
+  if props.get('private'):
+    parser.error('Cannot set commit on private issue')
   cl.SetFlag('commit', '1')
   return 0