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

Unified Diff: gclient_scm.py

Issue 505007: gclient: Add better error reporting when path is not a git repo. (Closed)
Patch Set: Added a test Created 10 years, 11 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/gclient_scm_test.py » ('j') | 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 23a5108570e1376ae1fb995cf0b2ddf701826244..010c45d183709586cdd42e2eec31aa585e050ca0 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -187,6 +187,14 @@ class GitWrapper(SCMWrapper, scm.GIT):
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
return
+ if not os.path.exists(os.path.join(self.checkout_path, '.git')):
+ raise gclient_utils.Error('\n____ %s%s\n'
+ '\tPath is not a git repo. No .git dir.\n'
+ '\tTo resolve:\n'
+ '\t\trm -rf %s\n'
+ '\tAnd run gclient sync again\n'
+ % (self.relpath, rev_str, self.relpath))
+
new_base = 'origin'
if revision:
new_base = revision
« no previous file with comments | « no previous file | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698