diff options
author | Warren Turkal <wt@ooyala.com> | 2013-11-27 16:20:57 -0800 |
---|---|---|
committer | Warren Turkal <wt@ooyala.com> | 2013-12-11 23:24:01 -0800 |
commit | 011d4f426c21a745387e62e6d67ddd73cd6ef44e (patch) | |
tree | a2f54bbc268e84c7207f1aa87110c7db1c8a548d /subcmds/upload.py | |
parent | 53d6a7b8955e9377cc0a12206be357e7936621b1 (diff) | |
download | git-repo-011d4f426c21a745387e62e6d67ddd73cd6ef44e.tar.gz |
Don't backtrace when current branch is not uploadable.
The backtrace currently occurs when one uses the "--cbr" argument with
the repo upload subcommand if the current branch is not tracking an
upstream branch. There may be other cases that would backtrace as well,
but this is the only one I found so far.
Change-Id: Ie712fbb0ce3e7fe3b72769fca89cc4c0e3d2fce0
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 7f7585ae..c8091078 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -422,7 +422,16 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
422 | for project in project_list: | 422 | for project in project_list: |
423 | if opt.current_branch: | 423 | if opt.current_branch: |
424 | cbr = project.CurrentBranch | 424 | cbr = project.CurrentBranch |
425 | avail = [project.GetUploadableBranch(cbr)] if cbr else None | 425 | up_branch = project.GetUploadableBranch(cbr) |
426 | if up_branch: | ||
427 | avail = [up_branch] | ||
428 | else: | ||
429 | avail = None | ||
430 | print('ERROR: Current branch (%s) not uploadable. ' | ||
431 | 'You may be able to type ' | ||
432 | '"git branch --set-upstream-to m/master" to fix ' | ||
433 | 'your branch.' % str(cbr), | ||
434 | file=sys.stderr) | ||
426 | else: | 435 | else: |
427 | avail = project.GetUploadableBranches(branch) | 436 | avail = project.GetUploadableBranches(branch) |
428 | if avail: | 437 | if avail: |