canBranchProject logic

Added canBranchProject function. It follows the logic outlined
in the existing cros branch tool -- if the branch-mode annotation
is set for a project, we use that. Otherwise, we peek at the remote.
As with most of these migration CLs, this ended up requiring me
to reimplement a bunch of stuff from chromite in Go.

BUG=chromium:980346
TEST=existing and new unit tests, run_tests.sh

Change-Id: I9099d2ea8cb01ca2ae54ba9ce6ad4f65b85aaf88
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/go/+/1696103
Reviewed-by: Jack Neus <jackneus@google.com>
Commit-Queue: Jack Neus <jackneus@google.com>
Tested-by: Jack Neus <jackneus@google.com>
5 files changed