From 160748f828f0fdaf09d3be86c73840d9e28eccdb Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 10 Nov 2020 01:09:51 -0500 Subject: [PATCH] upload: improve tip for fixing upload remote Instead of assuming the repo client is tracking the "master" branch of the manifest repo, use the existing info we have to display the right info to the user. Bug: https://crbug.com/gerrit/13339 Change-Id: I8b265f4b2e075fdc41909b1f3dff9aee87384353 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/287279 Reviewed-by: Michael Mortensen Tested-by: Mike Frysinger --- subcmds/upload.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subcmds/upload.py b/subcmds/upload.py index cc6ccf74..f441aae4 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -554,10 +554,10 @@ Gerrit Code Review: https://www.gerritcodereview.com/ avail = [up_branch] else: avail = None - print('ERROR: Current branch (%s) not uploadable. ' - 'You may be able to type ' - '"git branch --set-upstream-to m/master" to fix ' - 'your branch.' % str(cbr), + print('repo: error: Unable to upload branch "%s". ' + 'You might be able to fix the branch by running:\n' + ' git branch --set-upstream-to m/%s' % + (str(cbr), self.manifest.branch), file=sys.stderr) else: avail = project.GetUploadableBranches(branch)