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

Unified Diff: git_cl.py

Issue 2259993002: git cl patch: bail out quickly if there is no branch. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@fix-611020
Patch Set: Created 4 years, 4 months 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 | tests/git_cl_test.py » ('j') | 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 434cf45a48a10739d0ca1af231663fa7ca333f24..771c5c11bdd63e745dc02f4250b84b1306ab2d24 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -4406,6 +4406,8 @@ def CMDpatch(parser, args):
RunGit(['branch', '-D', options.newbranch],
stderr=subprocess2.PIPE, error_ok=True)
RunGit(['new-branch', options.newbranch])
+ elif not GetCurrentBranch():
+ DieWithError('A branch is required to apply patch. Hint: use -b option.')
michaelpg 2016/08/18 23:03:46 sweet, didn't know about that option
cl = Changelist(auth_config=auth_config, codereview=options.forced_codereview)
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698