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

Unified Diff: gclient_scm.py

Issue 2087015: When branch is not correctly set, it would throw an exception. (Closed)
Patch Set: Created 10 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 3a0b5371ce68198bd32483c4d0a9406952e14819..fb2ec28d745f14153f7bf20628ff6f73abe7519e 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -574,6 +574,8 @@ class GitWrapper(SCMWrapper):
# Returns name of current branch
# Returns None if inside a (no branch)
tokens = self._Run(['branch']).split()
+ if not '*' in tokens:
+ return None
branch = tokens[tokens.index('*') + 1]
if branch == '(no':
return None
« 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