buildman: Produce a sensible error message when branch is missing

Rather than a backtrace, produce a nice error message when an invalid
branch is provided to buildman.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2013-05-08 08:06:08 +00:00
committed by Tom Rini
parent 2a08b740e3
commit cce717a96c
2 changed files with 19 additions and 6 deletions

View File

@@ -111,6 +111,10 @@ def DoBuildman(options, args):
print col.Color(col.RED, str)
sys.exit(1)
count = gitutil.CountCommitsInBranch(options.git_dir, options.branch)
if count is None:
str = "Branch '%s' not found or has no upstream" % options.branch
print col.Color(col.RED, str)
sys.exit(1)
count += 1 # Build upstream commit also
if not count: