Commit 64e14364 authored by luqui@chromium.org's avatar luqui@chromium.org

Added error check to git cl that we are on a branch when we try to upload.

BUG=443264

R=iannucci@chromium.org,maruel@chromium.org

Review URL: https://codereview.chromium.org/811023003/



git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293537 0039d316-1c4b-4281-b951-d872f2087c98
parent 62554f9d
......@@ -1866,6 +1866,9 @@ def CMDupload(parser, args):
# TODO(ukai): is it ok for gerrit case?
base_branch = args[0]
else:
if cl.GetBranch() is None:
DieWithError('Can\'t upload from detached HEAD state. Get on a branch!')
# Default to diffing against common ancestor of upstream branch
base_branch = cl.GetCommonAncestorWithUpstream()
args = [base_branch, 'HEAD']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment