Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: git_cl.py

Issue 811023003: Added error check that we are on a branch when we try to upload. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Unintentional whitespace change Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index c881729c05c7b5763b3695997c51485102228b98..4c91b6c762147b7ce5c886df94d8fdd906995725 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -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']
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698