pre-upload: Verify the bug reference based on the upstream project.

When uploading patches to AOSP directly from a Chromium OS checkout, we
need to specify the bug number in a different format. This patch checks
the upstream project the branch is tracking and decides what format
should be used for the bug number line.

TEST=Added unittests.

Change-Id: I2084b4de7c55051bb229f1642384788916d1253b
Commit-Ready: Alex Deymo <>
Tested-by: Alex Deymo <>
Reviewed-by: Mike Frysinger <>
2 files changed