Update error message if unable to determine branch

git cl format can't accept branch name as argument as those are reserved
for files that need to be formatted. This CL clarifies what user needs
to do in case git cl is not able to determine upstream branch.

R=apolito@google.com, ehmaldonaldo@chromium.org

Bug: 832295
Change-Id: If6ff517d633b7e70a33dff48f3779f82df30f214
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2571838
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
changes/38/2571838/2
Josip Sokcevic 5 years ago committed by LUCI CQ
parent 276bab4c6e
commit b038f724ec

@ -1040,10 +1040,10 @@ class Changelist(object):
if not remote or not upstream_branch:
DieWithError(
'Unable to determine default branch to diff against.\n'
'Either pass complete "git diff"-style arguments, like\n'
' git cl upload origin/main\n'
'or verify this branch is set up to track another \n'
'(via the --track argument to "git checkout -b ...").')
'Verify this branch is set up to track another \n'
'(via the --track argument to "git checkout -b ..."). \n'
'or pass complete "git diff"-style arguments if supported, like\n'
' git cl upload origin/main\n')
return remote, upstream_branch

Loading…
Cancel
Save