cros_tryjob: Fix local branch-util tryjobs.

The branch_util tryjobs must run locally, since they depend on the
users git permissions, but also must be run without --debug. cros
tryjob didn't allow this. It does now, if --production is set.

Does a little cros tryjob refactoring to move all cbuildbot args into
CbuildbotArgs(), which allows better testing. Update the tests.

Also, tweak cbuildbot to allow --branch-name to be used with a
--branch if the branch is 'master' since we now set that on most
builds by default.

BUG=chromium:771776
TEST=cros tryjob branch-util  --local --production --yes \
     --branch-name test-foo --version X.Y.Z

Change-Id: I6f952b6691083a27fc9b39b3309cf7197db0e073
Reviewed-on: https://chromium-review.googlesource.com/701618
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 2cf39ff..5496325 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -632,7 +632,8 @@
       cros_build_lib.Die(
           'Must specify --branch-name with the %s config.',
           constants.BRANCH_UTIL_CONFIG)
-    if options.branch and options.branch != options.branch_name:
+    if (options.branch and options.branch != 'master' and
+        options.branch != options.branch_name):
       cros_build_lib.Die(
           'If --branch is specified with the %s config, it must'
           ' have the same value as --branch-name.',